Skip to content
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

Font dependencies #23

Open
scribblemaniac opened this issue Mar 31, 2016 · 1 comment
Open

Font dependencies #23

scribblemaniac opened this issue Mar 31, 2016 · 1 comment

Comments

@scribblemaniac
Copy link
Collaborator

scribblemaniac commented Mar 31, 2016

As far as I can tell, no module currently handles font dependencies. It's not that far-fetched to think that a project may use custom fonts, and if they are not installed on the user's system, it won't render properly. Almost all of the currently supported modules have some form of text object.

The solution can be broken up into three main steps. First, modules find the font names that are being used. Second, check to see if a font with that name is installed on the system. Third, installing fonts from files included in the renderchan directory (and possibly updating installed fonts if they have been changed in the local directory).

The first part is probably fairly easy to do for most modules, just look for the text object and check what font it is using. Unfortunately the other two parts are probably going to be really difficult to do. I briefly looked for other python project that are working with fonts, and found practically nothing. Seems like we'll have to manually go through the fonts folder and maybe use something like fontforge to parse the font files for the font names. If the font name is not installed, move the to the font folder and update the system font cache.

In short it's a major pain, but probably worth doing considering that custom fonts are quite frequently used.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/32463075-font-dependencies?utm_campaign=plugin&utm_content=tracker%2F513466&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F513466&utm_medium=issues&utm_source=github).
@morevnaproject
Copy link
Collaborator

In all my previous animation projects I've been following the philosophy that the project creator is responsible to bundle all font files into the project (see "fonts" directories here and here ).

This is possible because Synfig and Blender usually take fonts from particular files (they are not referencing them by name, but using actual paths to font files instead). So it isn't required to have them installed into system.

I agree, that implementing our own mechanism for installing fonts would really be pain. Also, installing additional fonts might break the look of operating system (at least on Windows). So I suggest to keep pushing the philosophy above with the following:

  • Publish recommendations for RenderChan users to bundle font files with the project.
  • When implementing the "pack" action (see Action: pack #14), we can check if some object/layer references system font by name and either give a warning or try to find and bundle font file into pack.
  • Some applications (Gimp/Inkscape?) doesn't support loading fonts from file. We can try to provide patches for them. Alternatively, (at least for Linux) we can do runtime tweaking of environment. For example, create temporary fonts.conf file and set the FONTCONFIG_FILE environment variable to point to it (see https://www.freedesktop.org/software/fontconfig/fontconfig-user.html). This is hackish, but will work for all applications, at least in Linux case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants