New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fonts are not reloaded even when changing on disk #112
Comments
I guess this is an apple CoreText issue... it seems like the fonts are cached. When installing fonts from the same source (path on disk) with the same |
How does RF manage to get this right with test install? Seems like it should be more or less the same mechanism. |
Here is a tangentially related problem: |
I guess you can embed two fonts with the same psname...
|
That works so well! Thank you Frederik! |
See: |
I have tested drawbot as a module and there is no font caching happening in my case when I generate a font and change it constantly and use it in a text inside drawbot. I also tested the script simultaneously inside the app and it seems font caching is persistent there. I don't know if this helps but there is a way to clear the font cache in the shell but maybe it's not what drawBot app is supposed to do or has the privilege to do? Clear font cache in shell:
|
that is true and also logic to explain as a font activation in the same runloop is different then activated in a separate runloop. Inside DrawBot every script runs in the same runloop while in terminal each time a script runs its a different runloop. Changing postscript names in the font makes a difference... I know this not always possible and just a dirty detour |
I am experiencing some difficult font caching while using DrawBot as a module. I've tried to follow this set of steps exactly, but I'm still running into a cached font:
Here is the current version of the folder I am working in, including the fonts: Within that, here's my DrawBot script: Pages 8 and 9 of my output PDF use the glyph However, I am so far completely unable to see the change in the DrawBot output, even after implementing a temp file with renamed name IDs 6 & 3. I have also tried using @typoman's command to clear my shell's font cache, to no avail. Is there anything I might be missing, here? |
I just do the following, which seems to work (dummy code):
|
Thanks so much for sharing your approach, @frankrolf! Strangely, this is generating a font for me, but it's still not working. Maybe it's something to do with this being a variable font? I'm not really sure. I adapted the code to change all the font family name IDs, and still no luck.
|
Ok, I've experimented, and I can get this to work for TTF and OTF (possibly woff/woff2), but not for TTC/OTC. However, for efficiency's sake, I propose a new function that explicitly reloads the font: reloadFont(fontNameOrPath) How about that? |
+1 for an explicit |
I managed efficient automatic reloading without the need for an explicit |
* remove unneeded call to installedFonts during newDrawing: that must have been a debugging leftover? * Implement implicit reloading of fonts if they're changed on disk. Fixes #112 * fix typo in comment * tweak comment * tweak comment
Definitely related. I just tried this particular scenario, and indeed, #421 + #422 fix this, too. |
After further thinking: #421 fixed this, by avoiding the font manager altogether. The (ps) font name is now completely irrelevant when using font paths. |
Awesome, thanks for making these upgrades! |
Automatic reloading as implemented in #422 does work for TTC/OTC after all. |
I am using DrawBot to create proofs, the fonts used in those proofs are re-generated frequently.
When I run the script from the DrawBot window, the font file that is picked up first stays active forever.
My script is wrapped like this:
I explicitly added the
newDrawing()
andendDrawing()
hoping it would have some kind of effect, but no.It works as expected when I run the script from the command line, but it sometimes is nice to have that visual output …
The text was updated successfully, but these errors were encountered: