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

Can we use the Cairo font api? #47

Open
jeroen opened this Issue Dec 3, 2018 · 4 comments

Comments

Projects
None yet
3 participants
@jeroen
Collaborator

jeroen commented Dec 3, 2018

Currently the package uses a mix of cairo and fontconfig apis. However fontconfig is a bit of a pain on Windows/Mac.

Cairo also provides high level font api which builds on the appropriate platform specific font-backend. On Windows it can use the native windows font apis instead of fontconfig.

The gdtools package would be more robust if it would only use font metrics via the cairo api and not include fontconfig directly. Would this be possible, or are there features in gdtools that really need fontconfig?

@davidgohel

This comment has been minimized.

Owner

davidgohel commented Dec 5, 2018

I think the first versions were not relying on fontconfig (but it is a long time I did not work on this and I need time to refresh my memory...). Also if I remember correctly, @lionel- needed fontconfig to be able to manage extra fonts with svglite and vdiffr.

Lionel, any thoughts on that?

@lionel-

This comment has been minimized.

Contributor

lionel- commented Dec 5, 2018

I think Jeroen is right that we should use the Cairo abstraction for selecting fonts, if possible. The problem is that the abstraction might be a toy or rudimentary abstraction. How does it work? Can you pass fontconfig-like patterns to select a font? Can you pass font files containing multiple fonts and select the right one based on a pattern?

@jeroen

This comment has been minimized.

Collaborator

jeroen commented Dec 5, 2018

I'm not super familiar with the font management, but R itself doesn't call font-config directly in the cairo devices, and neither do most libraries that rely on cairo for rendering (e.g. imagemagick). So probably graphical devices that use gdtools should be able to use the same mechanics?

@davidgohel

This comment has been minimized.

Owner

davidgohel commented Dec 5, 2018

yes I do agree. fontconfig was only used by font_family_exists at first and Cairo is having the same kind of function without fontconfig dep.

Can you pass fontconfig-like patterns to select a font? Can you pass font files containing multiple fonts and select the right one based on a pattern?

If all of that is possible, this will require time!

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