Hello Daniele,
I would like to call your attention to the TVirtualX interface class. That provides a set of the virtual methods to deal with the fonts.
http://root.cern.ch/root/htmldoc/TVirtualX.html#TVirtualX:SetTextFont
For example the TGQt (Qt-based implementation uses the Qt font management).
http://root.cern.ch/root/htmldoc/src/TGQt.cxx.html#TGQt:SetTextFont
The ROOT defines which one (from TTF or from TVirtualX) is to be used by query
http://root.cern.ch/root/htmldoc/src/TVirtualX.cxx.html#TVirtualX:HasTTFonts
method.
For example, Qt layer (see TGQt class) does use the font support provided by Qt.
This means to provide another font management it used to be enough to provide another implementation of
http://root.cern.ch/root/htmldoc/TVirtualX.html#TVirtualX:SetTextFont
That does not require any #ifdef clause.
However, I have to call your attention that the problem is slightly more difficult that one can imagine from the first glance.
One should bear in mind that the current design of ROOT font support was done to ensure "What you see on the screen What you get in Postscript file with the standard Postscript fonts". This implies the aspect ratios of the glyphs involved should match those from the "standard Postscript one" exactly.
Do you see any reliable solution of such dilemma?
Personally, I lack of expertise of UNIX font management to resolve the issue for my Qt layer (that one I am responsible for). I do not know whether the UNIX font management allows an application to embed the non-standard font into the postscript file.
At the moment, with Qt my need is just opposite of you yours :). Qt uses the not-TTF fonts and I want to teach Qt to use very TTF instead.
The Qt version uses the font’s management defined by the local Qt installation. However, ROOT still has to use TTF package to calculate the glyph layouts to favor the Postscript output and sacrify the screen images quality. (The "xft" fonts, that comes with Qt are slightly wider of the Postscript/TTF counterparts)
The switching things is as simple as provide "kFALSE" return value from TGQt::HasTTFonts() method.
but then everything is perfect on the screen and screw up in the Postscript.
Anyway I believe the ROOT team agree any idea that improves ROOT quality is welcome.
My best regards, Valeri
-----Original Message-----
From: owner-roottalk_at_pcroot.cern.ch on behalf of Daniele Nicolodi
Sent: Sun 7/17/2005 2:53 PM
To: roottalk_at_pcroot.cern.ch
Cc:
Subject: [ROOT] Fontconfig Support
Hello, one of the ugly things in root in my opinion is the dependency on the microsoft fonts. As first step to remove that dependency i want to code the support for the use of the fontconfig library to make root able to use the system wide installed fonts. Looking at the sources it looks like is enought to modity SetTextFont(const char *fontname) and SetTextFont(Font_t fontnumber) methods of the TTF class. The variation of those methods could be included in an #ifdef and enabled only if the fontconfig library is detected at config time so a new dependency is not realy introduced. What the main developers think about that proposal? Ciao -- Daniele Physics is like sex. Sure, it may give some practical results, but that's not why we do it. -- Richard P. FeynmanReceived on Sun Jul 17 2005 - 23:18:50 MEST
This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:10 MET