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

Remove dependency on Cairo and Fontconfig #39

Closed
ViralBShah opened this issue Apr 22, 2013 · 6 comments
Closed

Remove dependency on Cairo and Fontconfig #39

ViralBShah opened this issue Apr 22, 2013 · 6 comments

Comments

@ViralBShah
Copy link
Collaborator

It would be great if the dependencies on Cairo and Fontconfig could be removed, from an ease of installation perspective.

@dcjones
Copy link
Collaborator

dcjones commented Apr 23, 2013

I'd like to. The main thing that makes cairo/fontconfig required and not optional is that I need a way of estimating the size of text rendered in a particular font.

I haven't been following things very closely. Is the plan with the Graphics module to add a layer of abstraction here? Adding functions to compute text extents would help make this possible. I know that R's low level graphics api has these functions.

@ViralBShah
Copy link
Collaborator Author

@StefanKarpinski told me about the reason for fontconfig. Just thinking out aloud - would it be possible to say simplify things by just using a few fixed fonts and specific sizes, where these defaults are known? In case fontconfig is available, the general features could be turned on.

It is a good idea to add some of this to the graphics API that @JeffBezanson has started in Base.

@dcjones
Copy link
Collaborator

dcjones commented Apr 23, 2013

It would hard to do unless it was a monospaced font. Proportional fonts use kerning tables and ligatures, so computing text extents is complicated. That said, if it just made exaggerated guesses, the output would at least be legible, if a little sloppy looking.

@ViralBShah
Copy link
Collaborator Author

That's what I was going for - maybe give up some of the beauty in the short term for ease of use. Perhaps it won't be too bad.

@dcjones
Copy link
Collaborator

dcjones commented Jun 18, 2013

I have a fallback in place now. Glyph sizes for a handful of fonts are calculated in advance and included, if pango, fontconfig, etc can't be loaded, it uses those glyph sizes to estimate text extents.

Right now I'm still requiring the Cairo package, even though it's no longer strictly required. I don't think we have a way to have "recommended" packages.

@dcjones dcjones closed this as completed Jun 18, 2013
@ViralBShah
Copy link
Collaborator Author

Thanks! Why not just use try using Cairo and load it if it were found for now? With no dependency on Cairo this can become a pure julia package.

For the next level of greed, is it possible to get interactive graphics? I mean say plot and a window opens up with a plot in it, and then you can change labels and such, the way matlab does it.

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

No branches or pull requests

2 participants