【发布时间】:2019-01-27 15:59:08
【问题描述】:
我正在尝试使用 KML 在 Google 地球上的气球中格式化文本。无论我尝试哪种 html/css 技巧,我都无法使文本变粗。下面的示例演示了我能够将文本格式化为 Arial Black,但应用 font-family:'Arial Bold' 没有效果。 <b> 标签也不起作用。示例中未显示,我也尝试过<strong> 和font-weight:bold。
此屏幕截图显示了以下代码在 Google 地球中的呈现方式。文本“Unformatted Text”与文本“Arial Bold”和“b tag”具有相同的字体粗细,应该是粗体。但是,“Arial Black”文本按预期以 Arial Black 呈现。
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<name>Format Test</name>
<Style id="test-style">
<BalloonStyle>
<text>
<p style="font-family:'Arial Black';">Arial Black</p>
<p style="font-family:'Arial Bold';">Arial Bold</p>
<p>This text has a <b>b tag</b></p>
<p>Unformatted Text</p>
</text>
</BalloonStyle>
</Style>
<Placemark>
<name>Test Placemark</name>
<description><![CDATA['test']]></description>
<Point>
<coordinates>
-76.0,40.0,0
</coordinates>
</Point>
<styleUrl>#test-style</styleUrl>
</Placemark>
</Document>
</kml>
【问题讨论】:
-
你的 HTML 是实体编码的,你用实际的 HTML 标签试过了吗?相关问题/示例:Using <BaloonStyle> and <LableStyle> together
-
我已更新问题以删除实体编码并包含突出显示我在字体渲染方面遇到的问题的图像。
标签: html css kml google-earth