Open roberto-arista opened 2 years ago
Does it matter which font you use?
Apparently it does not, I tried RobotoFlex and one I am working on, but, they are bot variable fonts
I'll test a few more and report
A static font from Source Serif Pro triggers the same error:
2022-05-06 12:48:21.179 python[10684:119799] CoreText note: Client requested name "../font/Source_Serif_Pro/SourceSerifPro-BoldItalic.ttf", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
from the app it works fine
some testing: the “CoreText note" is reproducible with py3.10 pyobjc8.5
it does not happen with py3.7 pyobjc8.5
in both python version a pdf is written with the correct font.
reproducible with python py3.10, not with py3.7...
import AppKit
AppKit.NSFont.fontWithName_size_("../relativePath/font.otf", 10)
instead of trying to retrieve the font by name first, check if the font name is an existing path.
the problem is that dot prefixed font names are system font and this seems not to be allowed when requesting a font with AppKit.NSFont.fontWithName_size_
other solution: when a fontNameOrPath
starts with a "." it must be a path
dot prefixed fonts doesnt work anyhow...
hey all!
let's take the following example:
it works fine both in the app and from terminal. If, instead, I have the font placed in a folder that I have to access relatively, like this:
in the terminal, it triggers the following traceback
in the app works fine!