Why Some Truetype Fonts Render Poorly...

Chat about just about anything else
Forum rules
Do not post support questions here. Before you post read the forum rules. Topics in this forum are automatically closed 30 days after creation.
Locked
User avatar
Portreve
Level 13
Level 13
Posts: 4870
Joined: Mon Apr 18, 2011 12:03 am
Location: Within 20,004 km of YOU!
Contact:

Why Some Truetype Fonts Render Poorly...

Post by Portreve »

I've been thinking for a while now about addressing this topic, and much of my hesitation has revolved around concerns about potential copyright violations if instructions I might give could be taken as advocating the unlicensed use or usurpation of copyrighted font files. That said, I feel it should be safe simply to give an explanation as to why some Truetype fonts (generally certain ones bundled with versions of Windows, or MS Office) render very poorly on screen when installed on non-Windows-running systems. Also, it wouldn't be me if I didn't use this as an opportunity for a history lesson. So... here goes.

First off, I want to say this can potentially apply to fonts obtained from any source, though I've personally only seen this happen with specific fonts Microsoft ships with Windows or various versions of MS Office. Therefore, the explanation given and commentary on these fonts, towards the end of this post, should apply globally, and not just to those from those specific sources.


Some History:
The original way that fonts for any computer platform with a visual display were created was that a pixel-by-pixel graphic of every letter, number, and other symbol for a given alphabet was drawn using some kind of mechanism to do so. These pixel-by-pixel font data are called "bitmap fonts". As computer platforms developed and evolved, these bitmap fonts became more advanced and more refined but, nevertheless, remained stuck in this form, with likely some slight variance in resolution, and eventually as the so-called "platform wars" shook out all the different systems which existed, in essence leaving us with the Macintosh, the Apple IIgs, and x86 PCs running DOS plus some version of Windows, these bitmaps were pretty much all 72 dots per inch (or, dpi).

In the very early 1980s, Adobe Systems, Inc., developed a different, and professionally useful, way of handling fonts (and other graphics as well), which they named PostScript. Adobe took on the challenge, working in some form of collaboration with various different organizations whose entire purpose in life was to come up with typefaces, called "font houses", to build every single available typeface into a PostScript version.

PostScript was the initial (and still industry standard) way to draw vectorized curves. Those here who are familiar with Adobe Illustrator, Adobe (nee Aldus) Freehand, CorelDraw, Inkscape, and other such programs will be familiar with the idea of creating so-called "vector graphics" which have no set resolution, and which look perfect no matter how high the resolution of the device for which they're generated. This, then, is what PostScript brought to fonts. However, at the time, the processing power required to render vector fonts was pretty high, and so only a few extremely expensive workstation systems could show them on screen. The only other hardware of the era which could really do anything with PostScript fonts were PostScript-capable laser printers.

PostScript was originally designed to mesh perfectly well with the ASCII character system standard. However, this arrangement had some significant downsides because ASCII was only capable of dealing with 256 individual "characters", which among other things includes returns and backspaces and other non-printable characters. And so, regardless of PostScript's presence, support for non-roman characters required building ASCII characters appropriate to that other system in lieu of regular roman characters. This made different language system support anything from a nightmare to straight-up impossible. (This is its own separate subject, into which I will not digress here.)


Truetype; or, The First Public Anti-Proprietary Software Skirmish:
Most of the general public will be blithely unaware of it, but there was a fight towards the end of the 80s and start of the 90s over the proprietary and largely inaccessible nature of PostScript from the perspective of font designers. Moreover, at the time, fonts were incredibly expensive, and anybody working with them (graphic designers, print shops, etc.) could easily amass tens of thousands of dollars in font purchases. Adobe's (and those companies which Adobe allowed "under the tent") fonts were all of a format called "Type 1". Adobe had previously forked their standard into a slightly less-capable version, called "Type 3", but it was inadequate for full-quality font design. Adobe was adamant their system remain walled off, and the rest of the industry decided if they couldn't get Adobe to open it up by asking nicely, they would get them to open it up by introducing some competition. This, then, is the genesis of Truetype, to which Apple and Microsoft were collaborators.

It took a little bit, but once Adobe's font house licensees started losing customers to Truetype, which was open to anyone who wanted to design fonts and which also generally saw fonts selling for 1/10th to half of Adobe's prices, Adobe relented and opened PostScript authoring to anyone.

Around this time, Adobe released a program called Adobe Type Manager, or ATM, for Classic Mac OS as well as various versions of Windows, because by this time processing power had improved to the point that one could render fonts on-screen. Besides, starting with Windows 3.1 and Classic Mac OS 6.0.8 with the appropriate system extension, or natively in System 7 and later, one could already render Truetype fonts on screen.


Which Leads Us To The Point Of This Thread:
Historically, both Classic Mac OS and Windows 3.1.x and later required two font files in order to handle fonts: a bitmap, and optionally if better quality was desired, a so-called "outline" file (PostScript Type 1, Type 3, Truetype). In time, the need for bitmap font files has been eliminated. However, bitmap as a legacy format has remained with us, and (in some quarters) has been a bit harder to kill off than one might otherwise expect.

For simplicity of discussion, let us say there are two kinds of Truetype fonts; an individual font file, and a "Collection" file. In a way, a Truetype Collection, or ".ttc" file, is reminiscent of the way fonts were packaged in Classic Mac OS from the beginning up through its terminus with Mac OS 9.2.2. That is, you have a single file, and inside of that file you have individual font data for multiple typefaces or typeface weights (roman, italic, bold, bold italic, etc.) and so you need install one single file in order to have access to multiple faces.

Though it is not at all required for them to do so, Microsoft has, for several but not all of their TTC-shipped fonts, included bitmap data, and herein we get to the crux of this issue.

Systems such as both Mac OS X and the various GNU+Linux distributions, prioritize displaying fixed-point-size bitmap font data over outline data. This is stupid, and now in the year 2019 there is absolutely no valid reason for ANY system to continue to do this. Nevertheless, that's how it is for the moment.

Because our modern-day operating systems of choice PRIORITIZE BITMAP DATA OVER OUTLINE DATA, when you install, for example, Batang, Calibri, Cambria, Courier New, Gulim, MS Gothic, and MS Mincho, you will get extremely distorted font rendering for those specific fonts instead of how they look within Windows.


What Individual Users Can Do About This:
As long as you are using the latest released version of Fontforge, here's what you can choose to do with fonts for which there's no legal encumberment:

Use Fontforge to open up the requisite .ttc file. One at a time, open each typeface (roman, italic, bold, bold italic, etc.) and ignore any bitmap data you might see along the way, or any prompts you may be given to work with it.

Save each individual weight (that's the technical term for roman, italic, etc.) as a normal .tt (i.e. "Truetype") font file. Be sure to name these weights EXACTLY as you saw them named initially in the Truetype Collection file. In fact, when you open the thing up to begin with, write the names down to use later.

Once all the weights are extracted, open each of the weights up so that they are simultaneously displayed.

Tell Fontforge to create a new Truetype Collection. This will automatically incorporate the various fonts open at that moment in time.

Presto! You now have a brand new .ttc which contains only outline data. When installed, your operating system of choice will render them perfectly.


A Message Of Appeal To The GNU+Linux Developer Community:
The power to eliminate this problem is entirely within your own grasp. It ought not to be shoved off onto end users, and it by no means requires the violation of any license by the dev community to resolve this issue. The font-accessing, font-using, font-rendering subsystem need simply be changed such that if a font file it is already inherently capable of reading and using, which is installed on a system, contains both bitmap and outline data, it should ignore any bitmap data which matches up to some corresponding outline data (i.e. "Arial Regular", "Arial Italic", etc.) and in fact ONLY make use of bitmap data when there is no other corresponding outline data present.
Last edited by LockBot on Wed Dec 07, 2022 4:01 am, edited 1 time in total.
Reason: Topic automatically closed 30 days after creation. New replies are no longer allowed.
Flying this flag in support of freedom 🇺🇦

Recommended keyboard layout: English (intl., with AltGR dead keys)

Podcasts: Linux Unplugged, Destination Linux

Also check out Thor Hartmannsson's Linux Tips YouTube Channel
User avatar
AZgl1800
Level 20
Level 20
Posts: 11180
Joined: Thu Dec 31, 2015 3:20 am
Location: Oklahoma where the wind comes Sweeping down the Plains
Contact:

Re: Why Some Truetype Fonts Render Poorly...

Post by AZgl1800 »

I for one, could care less about who designed a font.

if I want it, I will use it.

But, in Linux, True Type has not performed well for me, and I use the defaults.
LM21.3 Cinnamon ASUS FX705GM | Donate to Mint https://www.patreon.com/linux_mint
Image
User avatar
RollyShed
Level 8
Level 8
Posts: 2438
Joined: Sat Jan 12, 2019 8:58 pm
Location: South Island, New Zealand
Contact:

Re: Why Some Truetype Fonts Render Poorly...

Post by RollyShed »

If using LibreOffice and someone sends you a doc or docx with the default Microsoft Office fonts of Calibri or Cambria, there are a couple of free fonts with exactly the same size and shape. This has been necessary when swapping and editing songs with someone running Microsoft Office and where the chord letter is on the line above the words. Spacing is critical to get things in the right place. It is also why, if not assisting with editing, such songs are swapped as PDFs.

Carlito (by Google) = Calibri (by Microsoft)

Caladea (by Google) = Cambria (by Microsoft)

Go to -

https://fontlibrary.org/en/font/carlito

and
https://fontlibrary.org/en/font/caladea

Download, extract then click on each font (standard, italic, bold) in turn and hit "Install".

Go to LibreOffice Write.
Open Tools
Options
Fonts
Tick "Apply replacement table"
Type in to the box under Replacement Table, Font:
Calibri
Replace with:
Carlito

Click on the Tick to the right and then click the box "Always"

Do the same for Cambria and Caladea.

When you get a document in say, Calibri, it will show in the font box as Calibri but actually be running/showing Carlito.

The same with Cambria and Caladea.
ajgringo619

Re: Why Some Truetype Fonts Render Poorly...

Post by ajgringo619 »

RollyShed wrote: Mon Jun 10, 2019 7:48 pm If using LibreOffice and someone sends you a doc or docx with the default Microsoft Office fonts of Calibri or Cambria, there are a couple of free fonts with exactly the same size and shape. This has been necessary when swapping and editing songs with someone running Microsoft Office and where the chord letter is on the line above the words. Spacing is critical to get things in the right place. It is also why, if not assisting with editing, such songs are swapped as PDFs.

Carlito (by Google) = Calibri (by Microsoft)

Caladea (by Google) = Cambria (by Microsoft)

<snip>
FYI - both of these fonts are already available on Mint: fonts-crosextra-carlito and fonts-crosextra-caladea.
RIH
Level 9
Level 9
Posts: 2892
Joined: Sat Aug 22, 2015 3:47 am

Re: Why Some Truetype Fonts Render Poorly...

Post by RIH »

Thank you Portreve.
Very interesting history lesson & solution.. :)
Image
User avatar
Portreve
Level 13
Level 13
Posts: 4870
Joined: Mon Apr 18, 2011 12:03 am
Location: Within 20,004 km of YOU!
Contact:

Re: Why Some Truetype Fonts Render Poorly...

Post by Portreve »

The entire point of this thread is education and perspective enrichment. I know what I wrote above is probably TL;DR for some, but I want people here on LMF to have the ability to broaden their knowledge horizons.

I'm willing to bet that even many GNU+Linux developers, whether attached to the LM project or something else, do not really know much about fonts or font history, and also quite possibly what I brought up in my initial post above — that is, the font handling subsystem functions in this way — so I wanted to broaden awareness.
Flying this flag in support of freedom 🇺🇦

Recommended keyboard layout: English (intl., with AltGR dead keys)

Podcasts: Linux Unplugged, Destination Linux

Also check out Thor Hartmannsson's Linux Tips YouTube Channel
User avatar
Flemur
Level 20
Level 20
Posts: 10096
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Why Some Truetype Fonts Render Poorly...

Post by Flemur »

To prevent the bitmap rendering with all fonts (as far as I can tell!), I put

Code: Select all

<fontconfig>
    <match target="font">
        <edit mode="assign" name="embeddedbitmap"><bool>false</bool></edit>
...etc...
in
~/.config/fontconfig/fonts.conf

It helps quite a bit with the appearance of some 'wine' programs.

Edit: Some useful info on mapping MS fonts to other fonts...
https://jichu4n.com/posts/how-to-set-de ... -on-linux/
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
User avatar
AndyMH
Level 21
Level 21
Posts: 13740
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Why Some Truetype Fonts Render Poorly...

Post by AndyMH »

Thanks, informative. I remember the days when one of the first things I used to do on a new windows install was install ATM. CorelDraw used to ship with a bunch of postscript fonts.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
User avatar
Portreve
Level 13
Level 13
Posts: 4870
Joined: Mon Apr 18, 2011 12:03 am
Location: Within 20,004 km of YOU!
Contact:

Re: Why Some Truetype Fonts Render Poorly...

Post by Portreve »

Just about the only Truetype fonts I use are ones which ship with LM or are in the repositories, and of course the Microsoft Core Fonts. Everything else for me are strictly OpenType fonts using PostScript for the outline data.

I've never really been much of a fan of Truetype.
Flying this flag in support of freedom 🇺🇦

Recommended keyboard layout: English (intl., with AltGR dead keys)

Podcasts: Linux Unplugged, Destination Linux

Also check out Thor Hartmannsson's Linux Tips YouTube Channel
Locked

Return to “Open Chat”