After my last post I was pretty clear on how evas font searching worked and how it could benefit from FontConfig. So, I knuckled down and put the fontconfig code into evas.
After initial testing in E17 I was disappointed to find that edje text classes were broken. The problem was that whenever a reference to an edje would be given up (when removing a border) all of the text classes would be wiped out. I found a problem with this and seem to have fixed it. The latest changes are in CVS.
Now, E17 does not have to install anyfont. This is good because now we don't have to install and package CJK fonts, which was an issue we have been working on for a long time. Of course, the old methods of font loading are still working as always.
My Font Setup
[shorne@Asus themes]$ enlightenment_remote -font-default-list
REPLY <- BEGIN
REPLY: DEFAULT TEXT_CLASS="menu_item" NAME="Sans" SIZE=9
REPLY: DEFAULT TEXT_CLASS="move_text" NAME="monospace" SIZE=12
REPLY: DEFAULT TEXT_CLASS="resize_text" NAME="monospace" SIZE=12
REPLY: DEFAULT TEXT_CLASS="title_bar" NAME="Serif" SIZE=12
REPLY: DEFAULT TEXT_CLASS="default" NAME="Serif" SIZE=12
REPLY <- END
[shorne@Asus themes]$ enlightenment_remote -font-fallback-list
REPLY <- BEGIN
REPLY <- END
I have started to learn a bit more about evas fonts. Actually, evas loads fonts using a name such as "Vera". If font fallbacks are wanted in evas they are encoded into the font name, like "fonts/Edje Vera Bold,ZYSong,Kochi-Gothic,Baekmuk-Dotum". The font configuration interface is just the evas_object_text interface. Fonts are found by name in the Evas font path. The evas font path is setup using evas_font_path_append. So, evas does not use the font file name to load fonts at the evas API level.
As I stated before, I am working on getting fontconfig to work in the EFL. Previously I made an error saying evas loads fonts using the font filename and that edje and ecore need to be exxtended. This is not true, evas implements the higher level font interface, only evas needs to be extended. Later, edje will have to be aware that evas supports fontconfig, this way edje could bypass having to setup font paths and font sources if desired.
My thoughts now, as advised by raster, are to add fontconfig directly into evas. This will of course be a compile time option via configure. The evas api will not change. However, evas fonts will be easier to use. If using fontconfig there will be no need to setup the Evas font path. Also, there will be no need to send a complete fallback list to the evas_object_text. This will be handled by fontconfig.
A few weeks ago re-compiled a few libraries and programs (GTK, Gimp, etc.) to take advantage of all of the new features, stability and eye candy. One of the programs that I compiled was fontconfig. After installing I noticed that all of my fonts had changed. I have figured out now that when compiling fontconfig my old configuration files in /etc/fonts were overwritten with the compile time defaults.
Eventually, I learned how to configure fontconfig and I was able to get much better results than what I had before. As a part time developer on the enlightenment project I have dealed with fonts before. I developed e17's font text class and font fallbacks configuration interfaces and have expirimented with asian language fonts. Currently, e17 and all of the efl have a very rudimentary where all fonts are shipped with programs or packaged in the edj theme files. This means that fonts get re-installed all of the time; just run locate *.ttf.
This is where fontconfig comes in; from the fontconfig RPM spec:
Fontconfig is designed to locate fonts within the system and select them according to requirements specified by applications.
This sounds like the efl could put this to good use. I have now started to write a wrapper for fontconfig which will go into ecore, this should be called ecore_fontconfig or ecore_fc.
- Ecore - Provides efl API style wrappers and helper functions for useful routines. ecore_fontconfig will provived an interface which, when gived a font familiy name. Will return a list of font files which implement this font.
- FontConfig - Will be used to locate fonts given a font family name. The returned data will either be the font data or just the file name.
- Evas - Evas currently loads fonts from a file name. This should not need to be changed.
- Edje - Edje uses fonts similar to the way HTML does. Currently edjes are shipped with fonts, this causes a big problem because we get loads of duplicate fonts with every edje install. I propose that we add ecore_fontconfig support to edje for finding fonts. Including inline fonts will still be supported.
- E17 - enlightenment 17 currently has a font fallback configuration interface. These fallbacks are used when the edje build-in fonts dont provide the correct glyphs. When fontconfig fonts are used in edje the enlightenment font fallbacks will not be needed.
- FreeType - Evas uses freetype to render fonts. Evas and Freetype are platform independant and should stay this way.
- Xft - The X freetype interface, this is not needed
- Xfs - The X font server, supplies font data to display servers, this is not needed
If you didn't know I work for an england based company called SurfControl. As I stated previously we recently had a high flux of new bugs in our RiskFilter product. Now that has settled and all of the software bugs are getting fixed. Actually all of the bugs have solutions except for one big nasty one in some native code which we interface with through JNI. The problem there is that the code is not maintained by the development team in Beijing so it's taking longer than usual to resolve.
Everything has been good in my personal life. I met a guy from Indonesia who also plays guitar. We jammed together the other day and our music was sounding really nice. I hope to get some good recording software installed on my machine soon so I can do some recording sessions and start posting them for download.
Well, the Chinese new years vacation is over. I have come back to work, and everything is reallycrazy. We have to create a new software release and new bugs are coming in every day. Well, that software engineering for you. "If the code was not tested by the developers, it doesn't work". Also, "Its not my bug"
During the vacation I went to Yuzawa Japan for snow and to meet with Asami. I had a great time with her and we enjoyed snowboarding for one day.
This is the sidewalk. Thats just snow on both sides of me, its not a wall.
The view from the ski resort.