Add custom fonts for screenplay and novel modes#197
Conversation
|
Wow, thank you! Could you walk me through what this actually changes in the big picture? Font manager is still used everywhere to provide the font based on the multiple custom settings, right? |
|
Yes, the font manager is still the source of truth. The change adds a custom-font path alongside the existing built-in font paths. In practice, the editor/export code still ends up with a The preferences/settings UI only saves the selected font name. The actual font objects are still created through The extra layout changes are mostly to handle arbitrary font metrics: custom fonts may be taller than the built-in Courier fonts, so line height is adjusted when |
|
The renderer will clip anything though, and in fact, that's an intended behavior, because of some kanji font weirdness. I wonder if there should be an overall warning about using a custom font altogether. Your implementation is a little cleaner than what I tried to do back in the day, but I think pagination code has to be adjusted to always squeeze fonts into the given line height, before this can be merged. I'll take a look at that when I can! |
|
Got it, that makes sense. I was treating the editor and renderer similarly, but I see why renderer should be clipping. I can adjust this so the editor avoids clipping for readability while the renderer keeps the fixed line height and scales custom fonts to fit instead of expanding the layout. I can also add a general warning that custom fonts may affect pagination/standard formatting. |
|
Custom fonts still go through the existing font rendering path, but pagination applies the same fixed-line-height fitting as the renderer. So the renderer can keep clipping while pagination measures against the same fitted font metrics. I also added a visible warning in Preferences whenever either screenplay or novel mode uses a custom font. |
Adds separate custom font preferences for screenplay and novel modes on macOS and iOS.
The editor and renderer now use the selected font for the matching mode while keeping screenplay pagination warnings for non-monospaced fonts. This also updates caret/selection font metrics so custom fonts align correctly in the editor.