vsariola / c64-cheat-sheets

5 stars 0 forks source link

Font issues #2

Closed bergfried closed 3 weeks ago

bergfried commented 1 month ago

I am not sure whether you are aware of it, and I am not a professional in this regard either, but the font you use seems to come with quite a bunch of legal strings attached. Apparently, using that font for anything other than embedding subsets of it is … complicated, so it really hinders collaboration, and if I were to create a CC-licensed work, I would try to avoid such a font. More details:

Now for the technical issues.

It is very helpful that you mention the fonts needed to display the SVG as intended. However, there are some issues. First of all, the heading at the top of the cheat sheet is not using the font "Tw Cen MT" but, more precisely, "Tw Cen MT Bold". You can fix this simply by stating that one needs to have the font family "Tw Cen MT" installed.

However, this will not be enough! According to my PDF viewer, the PDF you generate uses more fonts than the one you mention in the README.md. This might be due to some font substitution going on because the font you want to use might not provide all the glyphs you need.

So, I inspected the font you use using some shell magic demonstrated here, focussing on the characters that might cause trouble:

for c in '−' '⇒' '*' '†' '‡' '×' ; do
  printf '%x' \'"$c" | xargs -I{} fc-list ":charset={}"
done

If my investigations are correct, then, according to the output I got, the font you use does not feature the following two characters, namely

Thus, they always need to get their glyphs from elsewhere, which is why the current SVG file will, most likely, look different when opened in different setups, and the PDFs generated from the SVG will look different, too! (You can even spot one typographical faux pas due to this in your PDF alone: The correct minus sign looks exactly the same as the horizontal bar of the plus sign, and it also has the exact same position.)

If you are looking for a (hopefully) suitable font as a replacement, the Noto fonts might be a good start to solve both the substitution issue and the license issue. According to what I could find, they feature all the characters you need, and thanks to their license, it will be easy to get the fonts at all and then work with them without any legal strings attached.

A less intrusive way to fix some of the issues, at least for now, is to explicitly format the two problematic characters in the SVG using a less problematic font, e.g. Noto Sans Math. This will not solve all issues, but at least the SVG will look the same everywhere, provided that all the necessary fonts are installed.

vsariola commented 1 month ago

Thanks for all the input! I started working on this & started with seeing if I can change the font. Noto sans ain't bad, but I originally wanted to go for the classic Futura look, complete with black and red text. (Tw Cen Mt is a near-identical copy of Futura). I see Nobel is supposed to be close to Futura, and is similarly available font from Google with the same license. But I tested it and it was a bit light for my taste and didn't have all the font weights.

Anyway, while playing around with the fonts I started experiment with better ways to group the objects in Inkscape so changing the fonts would be easier. It'll take me some time to finish my experiments.

bergfried commented 1 month ago

Noto sans ain't bad, but I originally wanted to go for the classic Futura look, complete with black and red text.

I see. In this case, you might want to have a look at Jost. I just installed it on my system from the AUR and it works quite well but all characters appear to be a bit bigger. It does not feature a glyph for the arrow ⇒ but the other special characters seem to be covered, including the minus sign (albeit misplaced by a tiny bit). Note, however, that, with that font, the dollar sign $ looks very similar to the uppercase S. A workaround would be using Noto Sans Math for the dollar sign as well.

If this is not good enough, this Wikipedia article might also help.

EDIT: Interestingly, the PKGBUILD file (see AUR link above) points to a specific commit in the Jost repo which, apparently, features version 3.7 of the font.

EDIT: This article is about yet another alternative font.

vsariola commented 1 month ago

I'm happy to report that Jost seems like a very solid candidate :) Futura is a classic for capital letter text, which is rampant in the cheat sheet given the mnemonics and the titles, and Jost seems to work as a good replacement. I'll still mix in a bit of Noto Sans for the dollar signs and perhaps for the footnotes. And Noto Sans Math for the arrows. This takes some work to replace all the fonts and fix all alignment issues, but I'll report back when I have something.

vsariola commented 1 month ago

Have a look at the version here: https://github.com/vsariola/c64-cheat-sheets/blob/feat/more-illegals/6510_assembly_instructions.svg

The fonts used now should be Jost (most of the text), Noto Sans ($ signs) and Noto Sans Math (the function descriptions, because it includes the arrow).

I also exported it with Inkscape and the exported PDF (6510_assembly_instructions.pdf) for some reason indicates that some Cairo font is used; this seems to happen in the column / row titles, I'm wondering if it is because the titles mix Noto Sans and Jost, or is it because they use Jost with medium weight, or some other reason.

bergfried commented 3 weeks ago

(Moved from #2 to #1 and now back again to #2 because it is about the font now, not about the opcodes. Also, maybe dated.)

First of all, I stand corrected, the font I had in mind is actually called Jost (note the asterisk). And it looks quite different from Jost, too. (I think Jost is closer to the look you intended.) I am sorry for the confusion. I got the font files for version 3.7 (at least that is what it appears to be) from indestructible-type/Jost, commit 6eba3c279d0e3a17dbb891f569625bf0dd91aedb, as described in the PKGBUILD file mentioned in an earlier post in #2 .

Now to some issues I have found.

It appears that you try to make use of layers in Inkscape, albeit inconsistently. Maybe you should consider using another layer for rectangles that you only use as guides in order to avoid alignment issues.

By the way, in the preferences, you can ask Inkscape to notify you on opening a file if it makes use of fonts currently not available.

Also, I am experimenting with creating my own version of the cheat sheet. I am not sure whether it will work, but it is an experiment, after all. :-)

vsariola commented 3 weeks ago

Oh, given the issue was about fonts, I didn't imply anything else like alignments is ready. Just asking if you would agree with the fonts in the latest version. There's no point worrying about the alignments if the fonts are still changed. But from what I gather, the fonts are acceptable to both of us, even if Jost or Jost* ain't the same font?

vsariola commented 3 weeks ago

I'm also a bit confused about the claim that Jost and Jost not being the same font as I downloaded Jost from here: https://fonts.google.com/specimen/Jost and it looks very similar to the Jost here: https://indestructibletype.com/Jost.html

bergfried commented 3 weeks ago

I'm also a bit confused about the claim that Jost and Jost* not being the same font

Thank you so much for pointing this out. I think I have solved that mystery.

When I took a first glance at your most recent draft (PDF), I immediately noticed the mnemonics being bolder, so I jumped to the conclusion that it must be because of a different font (or more precisely, font family). In reality, version 0.1.0 of your PDF has the mnemonics written in a font similar to Jost with font-weight "Normal", while your current draft for version 0.2.0 uses Jost with font-weight "Medium" which is notably bolder but still part of the same font family, Jost.

And Jost and Jost, from what I have seen, do look the same, so their similarity is clearly not in name only. Except that for the OS, Jost and Jost are clearly different fonts, at least on my OS. When I had only Jost* installed, Inkscape complained about Jost not being installed when I tried to open your draft SVG file. Now that I have also Jost installed, everything works fine.

In other words, Jost and Jost are essentially the same to humans but not to software, so one needs to make sure that users of the SVG file have the correct* font family installed.

If I search for "jost font" (without the quote marks), I get the link you sent first to download Jost, and only few results further below, I get the link to the repo I referred to earlier for Jost . So it might be a good idea to agree on Jost (not Jost ) just because Jost is probably presented to users first. (Except if, for example, Jost and Jost* are somehow different from each other for other reasons like, maybe, license differences or project status, but I am not inclined to look any further into that.)

bergfried commented 3 weeks ago

But from what I gather, the fonts are acceptable to both of us, even if Jost or Jost* ain't the same font?

Yes, the font (Jost in this case) looks fine. I still need to adapt to the mnemonics being written with a different font-weight. If you want to keep the new font-weight there, you might also want to update the key to make it also use "Medium" (currently "Normal").

vsariola commented 3 weeks ago

My guess is that Owen Earl wanted to call it Jost* to make it look cool and hip. Then Google decided to distribute it as "Jost" because actually having a non-alphabetic character in a font name sounds like a recipe for disaster, because of filenames etc. But whoever built it from the source as a Linux package followed Owen's original wish.

Just a guess.

I'm not sure if I want to keep it "Medium" weight or make it "Normal" again, I need to test how it looks like when actually printed. I hope this is still one of those things you can print out and stick to the wall next to your computer.

vsariola commented 3 weeks ago

I worked a bit on this. I changed the font-weight of the titles back to "Normal" and bolded the top title again. I now use only Noto Sans Math and Jost to minimize the number of fonts needed and indicated this in the README.md.

Also the alignments were worked on, but that might be better addressed in the other issue.

6510_assembly_instructions.pdf

https://github.com/vsariola/c64-cheat-sheets/blob/dev/6510_assembly_instructions.svg

vsariola commented 3 weeks ago

I did somewhat silly thing: the PDF conversion are now done automatically with Github Actions, like so: https://github.com/vsariola/c64-cheat-sheets/actions/runs/10548994248

Also when there's a new release tag (e.g. vX.Y.Z) it creates the PDF artifact for the release.

vsariola commented 3 weeks ago

I am closing this issue as I think using Jost and Noto Sans Math solved it, and those fonts have already made their way to the latest master.