简体   繁体   English

Tizen WebView(EFL WebKit)中的CSS不支持字体家族

[英]CSS in Tizen WebView (EFL WebKit) wouldn't honor font-family

I am rendering some HTML using WebView based on EFL WebKit in Tizen 2.4 and 3.0 SDK. 我正在使用基于Tizen 2.4和3.0 SDK中的EFL WebKit的WebView渲染一些HTML。

<div className="hexArea" id="hexArea1">
  Content
</div>

and corresponding CSS: 和相应的CSS:

.hexArea {
  position: relative;
  height: 95%;
  padding: 3px;
  white-space: pre;
  text-overflow: clip;
  overflow: auto;
  border: 1px solid #0F0F0F;
  color: #0F0F0F;
  font-family: "Lucida Console", "Courier New", Courier, monospace;
}

While this works perfectly well on several platforms such as Desktop, Android WebView, iOS WebView, it does not show fixed-font on the Tizen App. 虽然这在桌面,Android WebView,iOS WebView等多种平台上都可以很好地工作,但在Tizen App上却没有显示固定字体。 I can't seem to set font for anything on the page. 我似乎无法为页面上的任何内容设置字体。

I tried style="font-family: 'monospace'" on the div , I tried to make the CSS just font-family: monospace , but the html on the Tizen WebView just does not seem to honor font-family . 我在div上尝试过style="font-family: 'monospace'" ,我试图使CSS成为font-family: monospace ,但是Tizen WebView上的html似乎并不尊重font-family

I am trying to display bytes in hex and decimal, and it looks horrible with normal font. 我正在尝试以十六进制和十进制显示字节,并且使用常规字体看起来很恐怖。 Any ideas how to fix it? 任何想法如何解决?

EDIT: I even tried <pre> tag but shows in normal font. 编辑:我什至尝试<pre>标签,但以正常字体显示。

Currently, Fixed font resources seem to be not provided in the Tizen SDK by default. 当前,默认情况下Tizen SDK中似乎未提供固定字体资源。 But it's possible to display a fixed-font in app side using CSS @font-face or the Google Font API. 但是可以使用CSS @ font-face或Google Font API在应用程序端显示固定字体。

 <html> <head> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto Mono"> <style> .hexArea { font-family: "Roboto Mono"; } </style> </head> <body> <div>normal font:1234567890</div> <div class="hexArea">fixed-font:1234567890</div> </body> </html> 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM