Build a fake SimSun font.

This commit is contained in:
Giovanni Mascellani 2021-07-15 16:06:40 +02:00 committed by Andrew Eikum
parent 920377546d
commit dfa5bf8c18
4 changed files with 34 additions and 1 deletions

View file

@ -343,6 +343,7 @@ $(DIST_FONTS): fonts
mkdir -p $@
cp $(FONTS_OBJ)/*.ttf "$@"
cp $(FONTS_OBJ)/source-han/msyh.ttf "$@"
cp $(FONTS_OBJ)/source-han/simsun.ttc "$@"
.PHONY: dist
@ -821,9 +822,26 @@ msyh.ttf_FEATURES = $(SOURCE_HAN_SANS_SRCDIR)/features.OTC.SC
msyh.ttf_SEQUENCES = $(SOURCE_HAN_SANS_SRCDIR)/SourceHanSans_CN_sequences.txt
msyh.ttf_UNISOURCE = $(SOURCE_HAN_SANS_SRCDIR)/UniSourceHanSansCN-UTF32-H
msyh.ttf_MENUNAMEDB = $(FONTS)/patches/YaHei-FontMenuNameDB
msyh.ttf = $(FONTS_OBJ)/source-han/msyh.ttf
simsun.ttf_CIDFONTINFO = $(SOURCE_HAN_SANS_SRCDIR)/cidfontinfo.OTC.SC
simsun.ttf_CIDFONT = $(SOURCE_HAN_SANS_SRCDIR)/cidfont.ps.OTC.SC
simsun.ttf_FEATURES = $(SOURCE_HAN_SANS_SRCDIR)/features.OTC.SC
simsun.ttf_SEQUENCES = $(SOURCE_HAN_SANS_SRCDIR)/SourceHanSans_CN_sequences.txt
simsun.ttf_UNISOURCE = $(SOURCE_HAN_SANS_SRCDIR)/UniSourceHanSansCN-UTF32-H
simsun.ttf_MENUNAMEDB = $(FONTS)/patches/SimSun-FontMenuNameDB
simsun.ttf = $(FONTS_OBJ)/source-han/simsun.ttf
nsimsun.ttf_CIDFONTINFO = $(SOURCE_HAN_SANS_SRCDIR)/cidfontinfo.OTC.SC
nsimsun.ttf_CIDFONT = $(SOURCE_HAN_SANS_SRCDIR)/cidfont.ps.OTC.SC
nsimsun.ttf_FEATURES = $(SOURCE_HAN_SANS_SRCDIR)/features.OTC.SC
nsimsun.ttf_SEQUENCES = $(SOURCE_HAN_SANS_SRCDIR)/SourceHanSans_CN_sequences.txt
nsimsun.ttf_UNISOURCE = $(SOURCE_HAN_SANS_SRCDIR)/UniSourceHanSansCN-UTF32-H
nsimsun.ttf_MENUNAMEDB = $(FONTS)/patches/NSimSun-FontMenuNameDB
nsimsun.ttf = $(FONTS_OBJ)/source-han/nsimsun.ttf
simsun.ttc = $(FONTS_OBJ)/source-han/simsun.ttc
#The use of "Arial" here is for compatibility with programs that require that exact string. This font is not Arial.
LiberationSans-Regular_NAMES := "Arial" "Arial" "Arial"
#The use of "Arial" here is for compatibility with programs that require that exact string. This font is not Arial.
@ -861,12 +879,16 @@ $(FONTS_OBJ)/source-han/%.ttf: $$(%.ttf_CIDFONTINFO) $$(%.ttf_CIDFONTINFO) $$(%.
(TEMP_DIR=`mktemp -d` && cd $$TEMP_DIR && $(AFDKO_VERB) sfntedit -a CFF=$(abspath $($(notdir $@)).cff) $(abspath $@.tmp) && rm -fr $$TEMP_DIR)
mv $@.tmp $@
$(simsun.ttc): $(simsun.ttf) $(nsimsun.ttf)
$(AFDKO_VERB) otf2otc -o $@ $^
fonts: $(FONTS_OBJ)/LiberationSans-Regular.ttf
fonts: $(FONTS_OBJ)/LiberationSans-Bold.ttf
fonts: $(FONTS_OBJ)/LiberationSerif-Regular.ttf
fonts: $(FONTS_OBJ)/LiberationMono-Regular.ttf
fonts: $(FONTS_OBJ)/LiberationMono-Bold.ttf
fonts: $(msyh.ttf)
fonts: $(simsun.ttc)
##
## Targets

View file

@ -0,0 +1,5 @@
[SourceHanSansSC-Regular]
f=3,1,0x804,\65B0\5B8B\4F53
s=3,1,0x804,\5E38\89C4
f=NSimSun
s=Regular

View file

@ -0,0 +1,5 @@
[SourceHanSansSC-Regular]
f=3,1,0x804,\5B8B\4F53
s=3,1,0x804,\5E38\89C4
f=SimSun
s=Regular

1
proton
View file

@ -446,6 +446,7 @@ class CompatData:
( g_proton.fonts_dir, "LiberationMono-Regular.ttf", "cour.ttf" ),
( g_proton.fonts_dir, "LiberationMono-Bold.ttf", "courbd.ttf" ),
( g_proton.fonts_dir, "msyh.ttf", "msyh.ttf" ),
( g_proton.fonts_dir, "simsun.ttc", "simsun.ttc" ),
( g_proton.wine_fonts_dir, "tahoma.ttf", "tahoma.ttf" ),
]