liyanrui / zhfonts Goto Github PK
View Code? Open in Web Editor NEWA ConTeXt (>= MkIV ) module that supports Chinese fonts.
A ConTeXt (>= MkIV ) module that supports Chinese fonts.
\usetypescriptfile[euler]
\usemodule[p][zhfonts][style=rm, size=9pt]
\setupzhfonts[math][%
roman=pagellaovereuler
]
\setuptype[space=on]
\type{hello world}
用了zhfonts後上述代碼中hello和world中間的空格被吃掉了
如想使用notosansmath字體作爲數學公式默認字體,應如何設置?
用了zhfonts後,\setupindenting[first,always,2em]會導致段落首行縮進大於兩個漢字,實際將近3個漢字了
能否扩展一下zhfonts,使得我们可以定义多套字体,就是说每一套字体都可以设置中、英文和sans、mono等字体
用的时候可以选择其中一套作为bodyfonts,其他的也可以任意切换使用
如題,貌似腳註中的中文無法斷行
加载zhfonts
出错,下面是部分日志,我认为可能是问题的根源,
open source > 4 > 5 > t-zhfonts.mkiv
loading > ConTeXt User Module / zhfonts
system > lua > loading of file 't-zhfonts.lua' failed:
t-zhfonts.lua:42: invalid escape sequence near '\m'
resolvers > lua > loading file 't-zhfonts.lua' failed
resolvers > lua > loading file 't-zhspuncs.lua' succeeded
看到那行t-zhfonts.lua:42: invalid escape sequence near '\m'
了吗?我不知道怎么去掉那个'\m'
。
我不能上传附件,只能复制一部分了。
There are some labels "\em" which is used for italic font in my tex generated from markdown doc using Pandoc tool. When I tried to convert tex with zhfonts module used to PDF, all the text after "\em" are lost.
Any clue to resolve this problem? Thanks a lot.
还有一个问题,就是我用context
编译出的中文PDF文件,页面右侧的汉字都跑出页面了,我不清楚这是为什么。如果是用xelatex
的话,指定documentclass
为ctexbook
、ctexart
这些,就可以解决这个问题。对于context
,我还没有找到解决方法。我之所以尝试context
,是因为context
比xelatex
快很多。我用的是 texlive 2016
,编译的是 texlive\texmf-dist\doc\context\third\context-notes-zh-cn\src
目录中的ctxnotes.tex
。我用的是Windows 10操作系统。
为了能够成功把ctxnotes.tex
转换成PDF文件,我把doc-env.tex
中的:
\usemodule[zhfonts]
改为了
\usemodule[simplefonts]
并且添加了下面一行:
\setmainfont[microsoftyahei]
其它的我什么都没改。
昨天更新了一下texlive用的pretest,結果編出來的文檔中沒有中文了,只剩下英文字符
示例:
\usemodule[newotf]
\usemodule[zhfonts]
\starttext
标点压缩测试:“有泪都成血!”。这是标点压缩测试!!!
\stoptext
结果会导致标点重叠。怀疑是 newotf 未能正确的识别中文字符的盒子信息,而我无法证实这一点。
不知道 newotf 以后会不会被用来替换 ConTeXt MkIV 的现有字体加载机制,如果那样的话,zhfonts 就寿终正寝了。
貌似在 \math 環境下使用 \tt\it 所顯示的字體不正確,將zhfonts的默認字號改成9.5等一些帶小數的就可以,這是怎麼回事啊
如何基於zhfonts定義新的字體集合?
\definexxx[newfontset][zhfonts]
使用與設置zhfonts同樣的語法設置newfontset:
\setupnewfontset[xxx][yyy]
我用的是 MacTeX 2013 中的context, zhfonts安装在 ./2013/texmf-dist/tex/context/third/zhfonts
且运行过luatools --generate
。使用时碰到如下错误信息:
! Undefined control sequence.
system > tex > error on line 4 in file type-myfonts.tex: Undefined control sequence ...
1 % engine=luatex
2 % \ctxlua{fonts.collections.trace = true}
3 \let\synchronizetext\relax
4 >> \synchronizemathfontsfalse
5
6 \spaceskip .25em plus .25em \relax
7
8 \definefontfeature[zh][mode=node,script=hang,lang=zhs]
9
10 \starttypescript [serif] [zhfont]
11 \definefontsynonym
12 [ZhSerif][name:AdobeSongStd-Light][features=zh]
13 \definefontsynonym
14 [ZhSerifBold][name:AdobeHeitiStd-Regular][features=zh]
context版本信息如下:
$ context --version
mtx-context | ConTeXt Process Management 0.60
mtx-context |
mtx-context | main context file: /usr/local/texlive/2013/texmf-dist/tex/context/base/context.mkiv
mtx-context | current version: 2013.04.20 01:15
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.