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
Make Graphics module use modern X fonts instead of X core fonts #4917
Comments
Comment author: Richard Jones I don't know how to delete files in Mantis. The first version of the patch contained a memory leak in caml_gr_draw_text. The second version corrects this. |
Comment author: @johnwhitington One of the reasons against adding anti-aliased primitives without a configuration option is that invalidates invariants like the ability to blank out a primitive after having plotted it by plotting the same primitive in the background colour, and people reading colours at a point from the image and relying on the result. So if we're going to go down this route without breaking existing programs, there should be a configuration option in the Graphics module to enable the antialiasing. |
Comment author: Richard Jones John is correct that with antialiasing you cannot overwrite a string with the background colour and expect that it will completely disappear (instead you will see that the outline of the font remains). However with FontConfig it's very easy to select non-antialiased fonts. Just add ":antialias=false" to the end of the font name, as in the example program below: open Graphics let () = A full list of FontConfig properties is here: |
The |
Original bug ID: 4917
Reporter: Richard Jones
Status: acknowledged (set by @damiendoligez on 2009-12-08T16:33:11Z)
Resolution: open
Priority: normal
Severity: feature
Version: 3.11.1
Category: otherlibs
Tags: patch
Monitored by: mehdi @glondu @hcarty @Chris00
Bug description
X core fonts have been deprecated for many years. Fedora are trying to identify pieces of software which still use X core fonts and could be changed to use modern X fonts (based on Xft and FontConfig). The OCaml Graphics module is one such place.
The attached patch changes the Graphics module to use modern X fonts. The changes are relatively simple - changing calls such as XDrawString to use the Xft equivalent (XftDrawString8).
One immediate advantage is that Graphics users will see anti-aliased fonts.
Another advantage is that Graphics users can specify font names like "Times-12" instead of the massive and incomprehensible XLFD strings ("--times--r-....")
File attachments
The text was updated successfully, but these errors were encountered: