amusewiki icon indicating copy to clipboard operation
amusewiki copied to clipboard

Multi-Font Support

Open ghost opened this issue 4 years ago • 1 comments

Presently amusewiki supports one font which is a problem for pdf builder if the included text contains characters outside the font range (for example, if one had a library with both Persian and Korean support, or wanted to transcribe Emoji Dick, amusewiki would not be able output a human-readable pdf).

The only font family I know of (and I know little) that is both 'free' and complete is Google's Noto, adding that as an option and having amusewiki figure out when to switch to each font file for a character range would probably be the most user friendly option, rather than having them select different fonts for each language family.

ghost avatar Nov 25 '19 08:11 ghost

seth1 [email protected] writes:

Presently amusewiki supports one font which is a problem for pdf builder if the included text contains characters outside the font range (for example, if one had a library with both Persian and Korean support, or wanted to transcribe Emoji Dick, amusewiki would not be able output a human-readable pdf).

@seth1

I understand the problem, but it doesn't sound too real. RTL support was started but never took off (the requestor disappeared). CJK is probably even worse, no idea if and how can be supported. Maybe it can, but requires someone (not a passer-by) with actual knowledge on these languages to make it work properly.

So the problem is more or less reduced to the Emoji. Honestly I don't think it would be an improvement to put emoji on a PDF. I think the Deja Vu fonts have some of them (and probably look pretty miserable, at least on a console).

The only font family I know of (and I know little) that is both 'free' and complete is Google's Noto, adding that as an option and having amusewiki figure out when to switch to each font file for a character range would probably be the most user friendly option, rather than having them select different fonts for each language family.

The fallback mechanism in the latex world kind of exists, but you have to specify ranges, which depend on the font you use and the language you use. Even if in theory it's doable, in practice it's a lot of work and complicates the matter for a remote option almost nobody is going to use.

Please note that the compiler issues a warning and logs that there are glyphs missing, so the user can go back and change fonts, but I guess you already know that.

So if the problem now boils down to adding Noto, please see this:

https://amusewiki.org/library/custom-fonts

which provides the needed mechanism to set the site fonts.

Last time I looked at Noto, it was splat in various font files, so you need a different file depending on the language you are going to use. If you try it out and let me know which files to use, I will be happy to add them.

If you feel brave you could create your own universal font with a font editor and copying glyphs, and offer it as option.

So much from me.

-- Marco

melmothx avatar Nov 25 '19 13:11 melmothx

This is addressed by the language switch. https://amusewiki.org/library/manual#toc37

melmothx avatar Nov 12 '22 09:11 melmothx