English 中文(简体)
如何从字体档案中删除特性?
原标题:how to remove characters from a font file?

i ve downloaded the DejaVu open source font and want to use it ad a WebFont, but even when converting it, i get a large file, and because the website i ll use will be only in few languages (arabic, french, amazigh) then, i dont need some characters.

so is there a way to browse the font file and delete the unnecessary range of unicode characters that i ll not need?

问题回答

FontForge。 您将看到所有现有范围,并可以选择一个统法协会整个编码范围,单独点击。 然后,你可以调整你的甄选,并删除<编码>Encoding->Detach & Remove Glyphs

也可使用<代码>。 Edit ->Select->Select by

为创建一套精细或减缩的精细体的新字体,File ->Generate Fonts...,然后在档案名称栏下选择一个自发文档类型,然后点击Generate

The easiest method I found is to use pyftsubset tool from FontTools. Here s an example:

$ pyftsubset NotoSans-Regular.ttf 
      --unicodes=U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116 
      --output-file=NotoSans-Regular.cyrillic.woff2 
      --flavor=woff2

注:woff2 输出要求Brotli

我写下了一个简单的文字,使整个过程自动化,包括在把字体档案分离后生成一个CSS文件。 您可在此查阅:





相关问题
Why are there duplicate characters in Unicode?

I can see some duplicate characters in Unicode. For example, the character C can be represented by the code points U+0043 and U+0421. Why is this so?

how to extract characters from a Korean string in VBA

Need to extract the initial character from a Korean word in MS-Excel and MS-Access. When I use Left("한글",1) it will return the first syllable i.e 한, what I need is the initial character i.e ㅎ . Is ...

File open error by using codec utf-8 in python

I execute following code on windows xp and python 2.6.4 But it show IOError. How to open file whose name has utf-8 codec. >>> open( unicode( 한글.txt , euc-kr ).encode( utf-8 ) ) Traceback ...

UnicodeEncodeError on MySQL insert in Python

I used lxml to parse some web page as below: >>> doc = lxml.html.fromstring(htmldata) >>> element in doc.cssselect(sometag)[0] >>> text = element.text_content() >>>...

Fast way to filter illegal xml unicode chars in python?

The XML specification lists a bunch of Unicode characters that are either illegal or "discouraged". Given a string, how can I remove all illegal characters from it? I came up with the following ...

热门标签