arch1t3cht / Aegisub

Cross-platform advanced subtitle editor, with new feature branches. Read the README on the feature branch.
http://www.aegisub.org
Other
695 stars 32 forks source link

[Feature Request] Limit Font Choices to User-Installed Fonts, or Any Arbitrary Subset #118

Open isrealityreallyreal opened 3 months ago

isrealityreallyreal commented 3 months ago

I've wanted this feature for a long time, but only recently remembered there was an active repo I could post a ticket on.

So basically, every time I go to choose a font, I have to scroll past this gigantic mass of DejaVu fonts to find the one I want:

image

The situation gets an order of magnitude worse if I have Noto fonts installed. However, DejaVu and Noto are both really nice to have as system-level fonts for other applications, so I don't want to uninstall them just to make Aegisub easier to use.

Is there any way to artificially limit the list of fonts that Aegisub sees? The easiest mechanism I can see for solving this is only having it look at the user-installed fonts directory (in my case ~/.local/share/fonts) and not the system fonts directory (in my case /usr/share/fonts), but if at all possible I'd like something even better: the ability to hot-swap lists of fonts depending on the use case. For example, if I'm typesetting a sign, I only want to see fonts that would be good for that, whereas if I'm choosing what font to use for dialogue, I generally choose between a completely different subset of fonts, so if I could just have these different subsets in different folders somewhere and hot-swap what folder Aegisub looks at that would be great.

Diagnostic Info

OS: Arch Linux Display Server: Wayland Desktop Environment: Gnome Build: Aegisub 9746-makepkg-aa68c2e66. (installed via yay and the aegisub-arch1t3cht-git AUR package

arch1t3cht commented 3 months ago

The font selection dialog is handled completely by wxWidgets's wxGetFontFromUser function, with which (as far as I know) the caller has no control over the set of fonts listed. So this wouldn't be possible without a lot of extra work of implementing such a dialog oneself.

That said, the common practice in typesetting is to use a font manager like FontBase instead of selecting fonts directly in Aegisub. That still doesn't make it easier to generate the actual \fn tag since FontBase (afaik) doesn't really tell you the relevant font name, but it gives you more control over what fonts you want to search.