Skip to content

Commit

Permalink
include Devanagari font (fixes #3576)
Browse files Browse the repository at this point in the history
  • Loading branch information
kjk committed Sep 16, 2023
1 parent a1f4a32 commit d1fe065
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 0 deletions.
12 changes: 12 additions & 0 deletions mupdf/fonts_32.asm → docs/fonts_32.asm
Original file line number Diff line number Diff line change
Expand Up @@ -234,3 +234,15 @@ __binary_NotoSerif_Regular_otf:

__binary_NotoSerif_Regular_otf_size
dq $ - __binary_NotoSerif_Regular_otf

; ----------

global __NotoSerifDevanagari_Regular_otf
global __NotoSerifDevanagari_Regular_otf_size

__NotoSerifDevanagari_Regular_otf:
incbin "resources/fonts/noto/NotoSerifDevanagari-Regular.otf"

__NotoSerifDevanagari_Regular_otf_size
dq $ - __NotoSerifDevanagari_Regular_otf

12 changes: 12 additions & 0 deletions mupdf/fonts_64.asm → docs/fonts_64.asm
Original file line number Diff line number Diff line change
Expand Up @@ -234,3 +234,15 @@ _binary_NotoSerif_Regular_otf:

_binary_NotoSerif_Regular_otf_size:
dq $ - _binary_NotoSerif_Regular_otf

; ----------

global _binary_NotoSerifDevanagari_Regular_otf
global _binary_NotoSerifDevanagari_Regular_otf_size

_binary_NotoSerifDevanagari_Regular_otf:
incbin "resources/fonts/noto/NotoSerifDevanagari-Regular.otf"

_binary_NotoSerifDevanagari_Regular_otf_size
dq $ - _binary_NotoSerifDevanagari_Regular_otf

4 changes: 4 additions & 0 deletions mupdf/source/fitz/font-table.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ ALIAS(noto, NotoSerif_Regular_otf, "Noto Serif", UCDN_SCRIPT_CYRILLIC, FZ_LANG_U
ALIAS(noto, NotoSerif_Regular_otf, "Noto Serif", UCDN_SCRIPT_COMMON, FZ_LANG_UNSET, NO_SUBFONT, REGULAR)
ALIAS(noto, NotoSerif_Regular_otf, "Noto Serif", UCDN_SCRIPT_INHERITED, FZ_LANG_UNSET, NO_SUBFONT, REGULAR)
ALIAS(noto, NotoSerif_Regular_otf, "Noto Serif", UCDN_SCRIPT_UNKNOWN, FZ_LANG_UNSET, NO_SUBFONT, REGULAR)

#define DEFNOTO(symbol, name, script) FONT(noto, symbol, name, script, FZ_LANG_UNSET, NO_SUBFONT, REGULAR)
DEFNOTO(NotoSerifDevanagari_Regular_otf, "Noto Serif Devanagari", UCDN_SCRIPT_DEVANAGARI)

#endif

#ifndef TOFU_NOTO
Expand Down
1 change: 1 addition & 0 deletions premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,7 @@ workspace "SumatraPDF"
"mupdf/resources/fonts/sil/CharisSIL-BoldItalic.cff",
"mupdf/resources/fonts/noto/NotoSans-Regular.otf",
"mupdf/resources/fonts/noto/NotoSerif-Regular.otf",
"mupdf/resources/fonts/noto/NotoSerifDevanagari-Regular.otf",
}

filter {'files:**.cff'}
Expand Down
39 changes: 39 additions & 0 deletions vs2022/mupdf.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -984,6 +984,45 @@
<Message Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">..\bin\bin2coff.exe "%(Identity)" "$(IntDir)/%(Filename).obj" _binary_%(Filename)_otf ARM64</Message>
<Message Condition="'$(Configuration)|$(Platform)'=='ReleaseAnalyze|ARM64'">..\bin\bin2coff.exe "%(Identity)" "$(IntDir)/%(Filename).obj" _binary_%(Filename)_otf ARM64</Message>
</CustomBuild>
<CustomBuild Include="..\mupdf\resources\fonts\noto\NotoSerifDevanagari-Regular.otf">
<FileType>Document</FileType>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\bin\bin2coff.exe "%(Identity)" "$(IntDir)/%(Filename).obj" _binary_%(Filename)_otf x86</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\bin\bin2coff.exe "%(Identity)" "$(IntDir)/%(Filename).obj" _binary_%(Filename)_otf x86</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='ReleaseAnalyze|Win32'">..\bin\bin2coff.exe "%(Identity)" "$(IntDir)/%(Filename).obj" _binary_%(Filename)_otf x86</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\bin\bin2coff.exe "%(Identity)" "$(IntDir)/%(Filename).obj" _binary_%(Filename)_otf x86_64</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug x64_asan|x64'">..\bin\bin2coff.exe "%(Identity)" "$(IntDir)/%(Filename).obj" _binary_%(Filename)_otf x86_64</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\bin\bin2coff.exe "%(Identity)" "$(IntDir)/%(Filename).obj" _binary_%(Filename)_otf x86_64</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Release x64_asan|x64'">..\bin\bin2coff.exe "%(Identity)" "$(IntDir)/%(Filename).obj" _binary_%(Filename)_otf x86_64</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='ReleaseAnalyze|x64'">..\bin\bin2coff.exe "%(Identity)" "$(IntDir)/%(Filename).obj" _binary_%(Filename)_otf x86_64</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='ReleaseAnalyze x64_asan|x64'">..\bin\bin2coff.exe "%(Identity)" "$(IntDir)/%(Filename).obj" _binary_%(Filename)_otf x86_64</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">..\bin\bin2coff.exe "%(Identity)" "$(IntDir)/%(Filename).obj" _binary_%(Filename)_otf ARM64</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">..\bin\bin2coff.exe "%(Identity)" "$(IntDir)/%(Filename).obj" _binary_%(Filename)_otf ARM64</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='ReleaseAnalyze|ARM64'">..\bin\bin2coff.exe "%(Identity)" "$(IntDir)/%(Filename).obj" _binary_%(Filename)_otf ARM64</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../out/dbg32/obj/x32/Debug/mupdf/NotoSerifDevanagari-Regular.obj</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">../out/dbg64/obj/x64/Debug/mupdf/NotoSerifDevanagari-Regular.obj</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">../out/dbgarm64/obj/arm64/Debug/mupdf/NotoSerifDevanagari-Regular.obj</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug x64_asan|x64'">../out/dbg64_asan/obj/x64_asan/Debug/mupdf/NotoSerifDevanagari-Regular.obj</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../out/rel32/obj/x32/Release/mupdf/NotoSerifDevanagari-Regular.obj</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">../out/rel64/obj/x64/Release/mupdf/NotoSerifDevanagari-Regular.obj</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">../out/arm64/obj/arm64/Release/mupdf/NotoSerifDevanagari-Regular.obj</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release x64_asan|x64'">../out/rel64_asan/obj/x64_asan/Release/mupdf/NotoSerifDevanagari-Regular.obj</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseAnalyze|Win32'">../out/rel32_prefast/obj/x32/ReleaseAnalyze/mupdf/NotoSerifDevanagari-Regular.obj</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseAnalyze|x64'">../out/rel64_prefast/obj/x64/ReleaseAnalyze/mupdf/NotoSerifDevanagari-Regular.obj</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseAnalyze|ARM64'">../out/arm64_prefast/obj/arm64/ReleaseAnalyze/mupdf/NotoSerifDevanagari-Regular.obj</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='ReleaseAnalyze x64_asan|x64'">../out/rel64_prefast_asan/obj/x64_asan/ReleaseAnalyze/mupdf/NotoSerifDevanagari-Regular.obj</Outputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\bin\bin2coff.exe "%(Identity)" "$(IntDir)/%(Filename).obj" _binary_%(Filename)_otf x86</Message>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\bin\bin2coff.exe "%(Identity)" "$(IntDir)/%(Filename).obj" _binary_%(Filename)_otf x86</Message>
<Message Condition="'$(Configuration)|$(Platform)'=='ReleaseAnalyze|Win32'">..\bin\bin2coff.exe "%(Identity)" "$(IntDir)/%(Filename).obj" _binary_%(Filename)_otf x86</Message>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\bin\bin2coff.exe "%(Identity)" "$(IntDir)/%(Filename).obj" _binary_%(Filename)_otf x86_64</Message>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug x64_asan|x64'">..\bin\bin2coff.exe "%(Identity)" "$(IntDir)/%(Filename).obj" _binary_%(Filename)_otf x86_64</Message>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\bin\bin2coff.exe "%(Identity)" "$(IntDir)/%(Filename).obj" _binary_%(Filename)_otf x86_64</Message>
<Message Condition="'$(Configuration)|$(Platform)'=='Release x64_asan|x64'">..\bin\bin2coff.exe "%(Identity)" "$(IntDir)/%(Filename).obj" _binary_%(Filename)_otf x86_64</Message>
<Message Condition="'$(Configuration)|$(Platform)'=='ReleaseAnalyze|x64'">..\bin\bin2coff.exe "%(Identity)" "$(IntDir)/%(Filename).obj" _binary_%(Filename)_otf x86_64</Message>
<Message Condition="'$(Configuration)|$(Platform)'=='ReleaseAnalyze x64_asan|x64'">..\bin\bin2coff.exe "%(Identity)" "$(IntDir)/%(Filename).obj" _binary_%(Filename)_otf x86_64</Message>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">..\bin\bin2coff.exe "%(Identity)" "$(IntDir)/%(Filename).obj" _binary_%(Filename)_otf ARM64</Message>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">..\bin\bin2coff.exe "%(Identity)" "$(IntDir)/%(Filename).obj" _binary_%(Filename)_otf ARM64</Message>
<Message Condition="'$(Configuration)|$(Platform)'=='ReleaseAnalyze|ARM64'">..\bin\bin2coff.exe "%(Identity)" "$(IntDir)/%(Filename).obj" _binary_%(Filename)_otf ARM64</Message>
</CustomBuild>
<CustomBuild Include="..\mupdf\resources\fonts\sil\CharisSIL-Bold.cff">
<FileType>Document</FileType>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\bin\bin2coff.exe "%(Identity)" "$(IntDir)/%(Filename).obj" _binary_%(Filename)_cff x86</Command>
Expand Down
3 changes: 3 additions & 0 deletions vs2022/mupdf.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -952,6 +952,9 @@
<CustomBuild Include="..\mupdf\resources\fonts\noto\NotoSerif-Regular.otf">
<Filter>mupdf\resources\fonts\noto</Filter>
</CustomBuild>
<CustomBuild Include="..\mupdf\resources\fonts\noto\NotoSerifDevanagari-Regular.otf">
<Filter>mupdf\resources\fonts\noto</Filter>
</CustomBuild>
<CustomBuild Include="..\mupdf\resources\fonts\sil\CharisSIL-Bold.cff">
<Filter>mupdf\resources\fonts\sil</Filter>
</CustomBuild>
Expand Down

0 comments on commit d1fe065

Please sign in to comment.