How to Name TTF Properly - windows

I am having trouble with something that appears to be trivial, namely how to name a font, so that I get multiple styles of the same font to tile, display nicely, import nicely using Inno Script Studio, work with C#, not to mention applications.
For instance, here is an Adobe font that work nicely, first what I see in Control Panel, then the TTF details. I will then show what I did with my font and how I do not see the exact same thing, even though I did seemingly the same thing.
Adobe Source Sans Pro Tiles
Adobe Source Sans Pro Details
Adobe Source Sans Pro Semibold: The purpose of a screenshot is to show what I see from the actual TTF using Birdfont font editor, plus version.
Here is the black:
PostScript Name: SourceSansPro-Black
Name: Source Sans Pro
Style: Black
Full Name: Source Sans Pro Black
Here is how I named the font that I am using on my project. The font name, Venera, is the font family and then these are the styles: 100 Extra Light, 300 Light, 500 Medium, 700 Bold, and 900 Black.
BTW, I tried with the numbers, without the numbers, with spaces, and no spaces. There was no combination that worked like what I see with the Adobe font.
PostScript Name: Venera-900Black
Name: Venera
Style: 900 Black
Full Name: Venera 900 Black
Here is the bold:
PostScript Name: Venera-700Bold
Name: Venera
Style: 700 Bold
Full Name: Venera 700 Bold
I did think that maybe styles cannot have embedded spaces, so I tried both 700Bold / 900Black as the Style and even just Bold / Black. The latter was my thought that Windows does not support numbers s part of style names.
What I see is the fonts not overlapping like Adobe, but stacked. One has to delete the TOP font to see that there is a font underneath. Needless to say, Word in such a case does not see both fonts.
Here is what I see after I install the 700 Bold bold font and then the 900 Black font. I took this screenshot after installing the 700 Bold style and before installing the 900 Black style, but the image is identical to what I see after 900 Black. The order makes no difference, I have to delete one font to see the other. The fonts are not stacked like what I see with Adobe. Restarting the computer makes no difference. Removing the numbers or spaces make no difference.
Image with BOTH fonts, just one would never know it from the screenshot.
I suspect that when I get this first part working that Inno Script wants the full name and not the font name as stated in the help material and pages here in SO, but first things first. I need to get the font behaving.
For whatever it is worth, I can set the style to Regular and then set the font name to: Venera700Bold and Venera900Black. I would then wind up with two different fonts that show Venera700Bold Regular and Venera900Black Regular in Control Panel. Inno Script Studio is then quite happy accepting Venera700Bold and Venera900Black as the font name in the Files section.
It is tempting to use this answer, but all the fonts are the same family and I would really rather do things the right way and not subject users to different fonts, especially when I have 7 different Avenir fonts that I have to do the same thing for.
The answer should be Font Name is alphanumeric with however many spaces. The style is alphanumeric with however many spaces. The full name, as the editor says is the concatenation of the font name and style. The unique name and PostScript name must have no spaces and have the style separated from the font name by a dash. Sadly, this recipe, which works for others, such as the Adobe font that I picked at random, does not work for me, so I am missing a piece to the puzzle in my understanding.
Thoughts?

The style names should not include the numeric weight values. The numeric values should only go into the font's 'OS/2' table, not in the name strings. If you include the numbers in the style string, then the OS or apps will probably get confused, treating the number as part of the family name.
If you tried just using "Bold", "Black" as the style names and that's not working, then I would suspect the tool used to create the fonts.

Related

Is Windows font substitution serif aware?

Windows has font substitution logic - if you try to render a character which isn't in the currently selected font, Windows would quietly pull a glyph from another font where a glyph
for that character is present.
Imagine the current font is, for example, a serif one. When picking the source for substitution, will Windows prefer serif fonts to sans-serif ones and vice versa?
As far as I know Windows uses the PANOSE values of a font to find a suitable replacement. Those values categorise the font into descriptive values, and there are in fact multiple values to describe the serif style.
The problem is, that only font with PANOSE values can be replaced by fonts with PANOSE values.
So if the font you’re using doesn’t have PANOSE values, Windows can’t find a replacement. Also, if it does and there are no fonts with fitting PANOSE values in your collection, you will get bad substitutions.
However, the PANOSE system was established for font replacement for PostScript printers.
I’m not sure how other people do it but I don’t provide all the information to the PANOSE values in fonts I produce (unless its explicitly asked). I stick to familytype, weight and letterform (though I use this only to decide between upright or italic).

transform a svg into a copy/paste-able emoticon like this one 🦄

Not sure if SO is the best place for this question, but don't know where else to ask.
Is there any way to transform a svg like this one for ex: (https://svgsilh.com/image/1775543.html) into something that i can use inside an editor with copy/paste like this one? 🦄
No, because the unicorn emoticon is one example of a character. And just as with letters, digits, and punctuation, the appearance of emoticons and other plain-text symbols is decided by fonts.
LSerni wrote the following:
The reason you can "copy and paste" that icon is that the icon already has a UTF-8 code and your editor is UTF-8 aware. And this is why the same emoticon is slightly different between Apple, Android and so on: it's because it's always code XYZ, but code XYZ is rendered with different icons on different platforms.
But that's not entirely correct. The difference in rendering lies more in the font than in the operating system that displays emoticons. Unless the font supplies its own version of a symbol, that symbol will usually be supplied by the font specified by default by the operating system, and different operating systems supply different symbol fonts.

How to find the default font for East Asian character in MacOS

When using a text edit application, a font (such as "Menlo") is selected to present glyphs, when the selected font doesn't contain a special glyph(such as “𠹷”, it's a simple Chinese glyph, "Menlo" doesn't contain it), Application will pick up a font for you to present it, In MacOS(Catalina), there are about 62 fonts (STBaoliSC-Regular, STKaiti, STSong, PingFangSC-Regular...) contain this glyph "𠹷", I found that almost every text edit application (vscode, sublime text, TextEdit) pick up the same font -- "PingFangSC-Regular" ,so I consider if it is every glyph has its own default font? if so, how can I get the font name?
This is handled by the "cascade list." If you want the default list, it's available through CTFontCopyDefaultCascadeListForLanguages, on a per-font basis:
import CoreText
let font = CTFontCreateWithName("Helvetica" as CFString, 12, nil)
let descriptors = CTFontCopyDefaultCascadeListForLanguages(font, nil)! as! [CTFontDescriptor]
If you wanted to see the list, you could do it this way (Core Text does not have very nice bridging to Swift):
for descriptor in descriptors {
let attributes = CTFontDescriptorCopyAttributes(descriptor) as! [String: Any]
print(attributes[kCTFontNameAttribute as String]!)
}
==>
LucidaGrande
.AppleSymbolsFB
GeezaPro
NotoNastaliqUrdu
Thonburi
Kailasa
PingFangSC-Regular
PingFangTC-Regular
AppleSDGothicNeo-Regular
PingFangTC-Regular
PingFangSC-Regular
PingFangHK-Regular
PingFangSC-Regular
HiraginoSans-W3
HiraginoSansGB-W3
KohinoorBangla-Regular
KohinoorDevanagari-Regular
KohinoorGujarati-Regular
MuktaMahee-Regular
NotoSansKannada-Regular
KhmerSangamMN
LaoSangamMN
MalayalamSangamMN
NotoSansMyanmar-Regular
NotoSansZawgyi-Regular
NotoSansOriya
SinhalaSangamMN
TamilSangamMN
KohinoorTelugu-Regular
NotoSansArmenian-Regular
EuphemiaUCAS
Menlo-Regular
STIXGeneral-Regular
Galvji
Kefa-Regular
.NotoSansUniversal
AppleColorEmoji
PingFangSC-Regular is the first East Asian font in the list, so it's going to be the one picked to replace Helvetica. It's also the first East Asian font in the cascade list for Lucida Grande, and Helvetica Neue. And it's kind of straight-forward, even boring, font. But if you were using a bit more unusual font, like American Typewriter? Well, that would be replaced with Songti, which is a bit lighter. Marker Felt replaces with Kaiti, which has more variation on the stoke widths (though IMO it would be much better to replace it with Kaiti Black rather than Regular). I don't know of any built-in Asian fonts that are as "fun" as the available Latin fonts, but if you had one, you can customize the cascade list to choose it instead (using NSFontDescriptor on Mac, or UIFontDescriptor on iOS).
If you want more details about cascade lists, see the WWDC 2018 video, Creating Apps for a Global Audience.

How to use different styles of local fonts in plots with Gadfly in Julia-lang on Mac?

I want to create plots with Gadfly in Julia programming language using a specific font style (e.g., Avenir Next Bold) of a local font (Avenir Next) on my Mac. It works for the standard font style in the case of an standard histogram example:
using Gadfly
plot(x=randn(2000), Geom.histogram(bincount=100),
Theme(minor_label_font="Avenir Next",
major_label_font="Avenir Next",
key_label_font="Avenir Next"))
Yet when a specific font style such as "Avenir Next Bold" is used the default font is applied instead of the provided one. The Avenir Next fonts are saved as a "container" in a ttc format. I tried to convert the ttc file into single ttf files for the font styles and to call the exact paths where the files are located. Both don't work.
I think this is a case of getting the font name exactly right.
(I used HeavyItalic because it's easier to tell if the correct font is chosen.)
It might be that you have to use the PostScript font name, although I'm not sure why that would be, unless deep down in Cairo that's how fonts are accessed... ?
You can get the PostScript names (if that's what they are) by looking at a font manager. For example, FontBook shows them on the info panel:

Is it possible to determine the fonts Windows chooses for font-linking?

Suppose you have a string with text in two or more scripts. When you use a GDI function like TextOut, (modern versions of) Windows will do "font-linking". That is, GDI will draw what it can with your selected font and draw the rest in an appropriate font that it chooses automagically. For example, if part of your text is in English (using the Roman alphabet), and part of it is Chinese (using CJK characters), and you have Arial selected, the English portion will be drawn in Arial, and the Chinese portion will be drawn in another font that has the CJK glyphs.
My question is, is there a way to determine which fonts TextOut will choose (or did choose) for the font linking?
I have to draw some text with the low-level Uniscribe API, which doesn't do automatic font-linking. I've implemented my own font-linking, but sometimes my algorithm chooses a different font than TextOut does for the same text. I'm trying to understand the Windows algorithm better, but I'm not real good at identifying fonts on sight (especially in unfamiliar scripts).
The font is selected by a registry entry. It is well described in this article. Quoting the relevant part:
If font linking is enabled on your
device, you can examine the registry
by enumerating the subkeys of the
registry key at
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\FontLink\SystemLink
to determine the mappings of linked
fonts to base fonts. You can add links
by using Regedit to create additional
subkeys.

Resources