How do I add Asian language fonts to Mono Linux? - linux

Linux 5.19.10-arch1-1 x86_64 GNU/Linux
I already have several Asian language fonts installed on the system, and they work fine in GTK & QT apps. But Mono seems to default to one of the default Windows fonts. (Understandable.) Which while breaking the system UI, would be fine if it wasn't lacking Asian language character sets. Specifically Japanese if that matters, I presume it doesn't since Asian language character sets are typically bundled. Unless I need to give a specific language/locale flag.
I tried Googling how to add Asian font support to Mono Linux, but Google AI misinterprets me and thinks I'm searching for Monospaced Asian Language Fonts for Linux. 🤦‍♂️ I tried searching the Mono documentation for font and fonts but it did not turn up anything useful. Is there anyway to add more available fonts to Mono? (it apparently isn't just using the system fonts folder) Or even just a way to force it to use a specific font?

Related

What is responsible for font rendering on linux?

I am sorry if my question is a bit vague. I am trying to understand where to look for my problems. I have a regression test suite that captures and compare the screen. It seems like whenever we do some kind of library upgrade the regression tests would fail. Our font settings are the same. The difference would be like the graphics card upgrade (driver), window manager upgrade, or just third party library upgrade (for example Qt library). From human visual testing, the fonts look almost identical, but if I do pixel to pixel comparison, it would show that the snapshots are different. Does anyone have insight how the fonts are rendered ?
Graphics rendering on Linux is a proper mess. While Linux is about as old as Windows, Linux first tried to copy the old X11 window system. This was one of the oldest GUI systems in the world, and it shows - the API is beyond horrible. As a result, lots and lots of libraries were stacked on top of X11 to make it workable, with various degrees of compatibility.
To make things worse, X11 was not just a single implementation, there were competing X11 implementations. Linux chiefly used XFree86, which later became Xorg. And because that's not confusing enough, recent developments added a number of alternatives to X11, which support backwards-compatibility interfaces to X11. Some of those GUI libraries on top of X11 are aware of these new libraries, and may now use the new interfaces.
So, you basically have a pretty fragile system, and any library with a decent programming model has shaky foundations. It's no wonder that changing any part may suddenly cause re-rendering, possibly even choosing entirely new rendering paths.
Windows is a bit better, but it too is old and has some competing GUI libraries. The reason why it's better is probably threefold: there's a single party in control of all the interfaces (Microsoft), they were aware of the bad X11 design from the start (avoided beginner mistakes) and Microsoft has far more resources to spend.
But still, both Linux and Windows had to evolve to support Unicode and the much larger fonts it brought, 24 bits color, high-DPI screens, LCD screens with subpixel resolution, accelerated GPU's, etc. And it's been hard for both to dump old interfaces.

Lato font rendering issue on Debian gnome3

I tried to fix font rendering on my Debian 8 computer and with this instructions (http://forums.debian.net/viewtopic.php?f=16&t=88545) i installed infinality. So it helped and now I get much smoother fonts but there is one big problem, font named Lato is completely broken. Look.
This is not a big problem, but this font is used literally everywhere in the web. And this problem not only in firefox, but in whole system. How to fix it? Or I should remove infinality?
infinality is designed to mimick a very specific font rendering found on windows systems. Because MS developed this rendering with a specific font set, it does not work on any random font, since it is designed to hide bugs in windows fonts and windows fonts are designed to hide bugs in windows rendering (that's the problem when you develop code and fonts at the same time).
The default Linux rendering is much more font-agnostic but it is anathema to anyone coming from Windows or OSX (for radically different reasons).
It is useless to explain to any user that the text rendering he is used to is not the alpha et omega, and there are enough ex-windows people they've pushed infinality to the top of the charts

Why don't cross-platform applications like Chrome use FreeType to render text?

Just looking through the list of issues for the chromium project, a large number of them are cross-platform text rendering issues. Having to use the platform's text rendering system, and cater to their respective idiosyncrasies, I imagine is a lot of work.
Why not simply use the FreeType library and be done with it? FreeType is used in Linux, iOS and Android, among other platforms. So on these platforms, browsers are using a wrapped FreeType library anyway. Why not scrap that wrapping, scrap the platform-supplied rendering on Windows and Mac, and go pure FreeType?
The only answer that occurs to me is that perhaps it's to take advantage of the hardware accelerated composition and blending of glyphs that Windows- and Mac-supplied rendering offers.
Or my other answer is that perhaps it was because WebKit was ported before the subpixel antialiasing patents had expired, so the only way to get subpixel antialiased text was to use platform-supplied rendering.
Are either of these correct? If not, what is the case?
When Safari was ported to Windows, it came with a port of Apple text renderer. Popular opinion was that the text was blurry and illegible.
People get really, really used to how their system renders text and react very sensitively, and very annoyed indeed, to anything different.

how Font and text rendering is done in different OSes

How font rendering is done in linux, bsd, windows? how they differ?
I am not talking about browser web font rendering.say for example how input system works? I press mouse keys. they trigger evdev drivers of linux kernel, and the kernel manages the higher level ops.
low level font rendering mechanism. how freetype, pango, window manager, interact with each other. another big question? how unicode support is accomplished??
simply, when I type a character in a text editor, what are the paths does the character flow before coming into the screen. how the MS word or LibreOffice render different fonts together in single canvas??
On *nix text-rendering is done client-side nowadays which means apps use whatever lib they like best to transform unicode codepoints to pixels and feed the result to x. The actual libs used wary widely though people has been converging on fontconfig + freetype + freebidi + harfbuzz in the past years, usually accessed through pango-cairo
A summary was posted here a few years ago
http://behdad.org/text/
It's all a devilishly complex process, you have weeks of reading if you want to understand all the steps involved.
text-rendering linux fonts

Safe fonts all browser and os [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Is there any standard that has a list of web-safe fonts
Is there a list of safe fonts for all browser and os?I use generally tahoma and there isn't any problem for windows but I don't know is there a problem about linux or mac
There's this page, I had it in my Firefox Scrapbook. It covers some of the most useful, widespread fonts and their closest equivalents. Yes it focuses on Windows and Mac. There's a linux/ubuntu/gnome screenshot of the font rendering down there: bottom of the page.
Be wary: this topic is controversial. From a pure design standpoint, the point is moot: there are no equivalent fonts. Never. Using core system fonts your mileage (and your ex width) will vary so wildly that most would simply advise you not to even start.
If you are serious about typesetting you should anyway be using fontsquirrel, google web fonts, or any other #font-face trick. With those, backward compatility will (sort of) be an issue, but not one that's typically considered relevant on linux. (those guys update like crazy)
There are some corner cases though, where I believe this approach is sensible. E.G. You could be searching for a very readable font, and prefer not having the user downloading it. Or you could be in love with some widespread commercial typeface, but can't/won't license it for a reason or the other. (e.g. I personally love the readability Palatino Linotype gives me on Windows)
A last word of warning: if you're targeting mobile devices this approach will drive you insane. Don't even start, or you'll expose your frail soul to the blows of the unmotivated horrors that inhabit Mobile Safari updates. Sanity can't last long under that kind of crossfire.
Short answer: no
There is no guarantee that any given browser / OS will support a specific font.
You can specify families of fonts from which the browser will select the first available font e.g.,
font-family: Arial, Helvetica, Sans-Serif;
This is probably the closest you will get to what you want as it should at least select something of the desired style, if not the exact desired font.
You might take a look at Microsoft's Core fonts for the web project. These fonts are available for Windows, OS X, and Linux-based OSes (among others), but again there is no guarantee that these will be available on any given host.

Resources