Alternative web-font to render Khmer

纵然是瞬间 提交于 2019-12-29 02:07:31

问题


What is web-fonts (preferably available from Google Fonts) supports Khmer UI.

I have tried to define font-family:khmer ui; but it does not render even though I have the font installed on my computer.


回答1:


Khmer (Cambodian) is pretty poorly supported but there is a convenient option which is as simple as Google Web Fonts. There is in fact a Google Web Font that works.. see jsFiddle

Google has a little known resource called Early Access fonts which is accessible from the "More scripts" hyperlink on the upper right side of the page on the typical Google Fonts webpage. Currently available in the Early Access resource are fonts for Hebrew, Arabic, Lao, Ethiopic, Tamil, Thai, Korean, Bengali, Hindi, Myanmar, Armenian, Cherokee, Georgian, Gujarati, Gurmukhi, Japanese, Kannada, Khmer, Malayalam, Osmanya, Telugu, Chinese (traditional)

<link rel=stylesheet href="http://fonts.googleapis.com/css?family=Suwannaphum">
<p style="font-family: Suwannaphum,DaunPenh,Code2000;font-size:130%;">ខ្ញុំអាចញ៉ាំកញ្ចក់បាន ដោយគ្មានបញ្ហា</p>

Further:

  • Google Web Fonts Early Access Discussion Board



回答2:


Add this link to your page:

<link href='http://fonts.googleapis.com/css?family=Khmer' rel='stylesheet' type='text/css'>

Then apply the style for any element you want:

font-family: 'Khmer', cursive;

For more info take a look here: https://www.google.com/fonts#UsePlace:use/Collection:Khmer




回答3:


The font "Khmer UI" (as mentionned into the original post) doesn't exist in the Google font collection. If you want to find what is the nearest font, go the the Google fonts website. In the left sidebar, select Khmer into Script field. The Google fonts displaying Khmer characters will be listed.

You cannot embed a font that is not installed on the computer where your website is used (the user/browser needs to install it prior using it). As stated into another answer you need to link to the place where your users can download the font (Google font API or your webserver). Otherwise, the browser used to display your website will use a default font.

For example, if you have selected the first font nammed "Hanuman", you need to add this link into your HTML code :

<link href='http://fonts.googleapis.com/css?family=Hanuman' rel='stylesheet' type='text/css'>

And to apply the style wherever you want to use the font. All you need to do is add the font name to your CSS styles. For example:

font-family: 'Hanuman', serif;

Another great Google project is the noto font : a font that will contains all known Unicode characters.

Remember that few fonts contain the Khmer letters.



来源:https://stackoverflow.com/questions/23948474/alternative-web-font-to-render-khmer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!