User:Mjb/GDI++
From Offset
Contents |
GDI++
Here is where I'm keeping track of my efforts to build and use GDI++.
Documentation and links
As written and translated by "◆0x0D/0x20I"/"drwatson.exe", who wrote the original version. He says he's no longer developing it, himself. The italicized text below is what he wrote to me.
- gdi++ = original version
- no development since '06
- doesn't support the Cleartype-ish rendering (well, it does, but is very buggy & useless)
- http://drwatson.nobody.jp/gdi++/ - author's site
- gdi++/FreeType = new version
- http://www18.atwiki.jp/gdiplus2/ - This is a user-driven wiki about gdi++ and it mainly focuses on the FreeType versions. However, it is far from a well-organised wiki and hard to get information we need, even for Japanese... One of the reason for that is the developers want to keep it secret in a way, because they hate a sort of people who doesn't understand how it works and how dangerous and unstable it is.
- http://pc11.2ch.net/test/read.cgi/win/1192649107/ - This is where new binaries and sources of gdi++/FreeType will be premiered. If you want to check latest information, you should visit this place first. Of course it is written in Japanese (with bunch of Internet slangs), but you can translate it into English by using Google: (link). Terrible translation would be included, but better than nothing. :)
- http://free.flop.jp/gdi++/ - This is a website called 'uploader' where almost all the binaries, sources, screenshots are uploaded by the developers and users.
- http://free.flop.jp/gdi++/oldsrc/gdi0787.lzh - This seems a set of a current rather stable version of gdi++/FreeType. It doesn't include pre-built 'FreeType2.dll', so you have to extract it into the same directory from this package.
- http://free.flop.jp/gdi++/oldsrc/gdi0756.lzh - gdi++/FreeType doesn't have a GUI for configuration and this tiny tool helps you instead of editing 'gdi++.ini' directly.
- http://free.flop.jp/gdi++/src/gdi0808.txt - This is the English translation of the main document of gdi++/FreeType by me.
- gdi0787.lzh includes two useful utilities, gdippManager.exe and gditray.exe, apart from gdi++.exe which is mentioned in the translated document. Both two enables you to switch different configurations and apply them quickly, but hopefully gditray.exe seems to have English resource, so I suppose it's much easier to use.
- http://bbs.themex.net/forumdisplay.php?f=40 - Some Chinese comunities seem interested in this gdi++/FreeType thing recently.
Build FreeType 2
This turned out to be unnecessary; as I mentioned above, there's a freetype2.dll in gdi0770.lzh that works just fine.
Get sources
- Get Freetype2 sources (get the .zip so they have CR+LF newlines) from http://sourceforge.net/project/showfiles.php?group_id=3157
- Extract them to C:\dev. A freetype-2.3.5 or whatever folder will be created there.
Build
- Open C:\dev\freetype-2.3.5\builds\win32\visual\freetype.sln in VC++ (just double-click it).
- In VC++, modify the freetype project properties to use /arch:SSE for the release build.
- In the freetype solution's config manager, select the release build.
- F7. This should produce a C:\dev\freetype-2.3.5\objs\freetype235.lib file as well as a C:\dev\freetype-2.3.5\objs\release folder full of .obj files.
OK, here is the first problem. The instructions call for me to have a "freetype.dll" (dynamic library), but the default configuration produces "freetype.lib" (static library). I can change the file name and type in the project properties, but do I need to?
At this point I'm in over my head, so for now I will just use the freetype2.dll from gdi0770.lzh.
Settings
Here's the first gdi++_sse.ini that I was happy with:
[General] HookChildProcesses=1 FontLoader=0 [FreeType] WidthMode=1 HintingMode=1 AntiAliasMode=2 TextTuningR=1 TextTuningG=1 TextTuningB=1 BolderMode=0 GammaMode=0 GammaValue=1.7 Contrast=1.1 LoadOnDemand=0 LcdFilter=1
My current gdi++_sse.ini is here: http://skew.org/~mike/tmp/gdi++_sse.ini
Pretty much any application will use GDI++/FreeType on my boxes (Pentium III/Win2K, Pentium M/Win2K, Pentium M/WinXP) if I invoke them like this:
-
C:\apps\gdi++\gdi0787\gdi++_sse.exe C:\WINNT\System32\notepad.exe
This is awesome!
Notes
- WidthMode=1 really helps kerning, but doesn't do anything if FontLoader=1. I don't see any advantage to using FontLoader=1.
- If LcdFilter is 0 (none), the antialiased pixels are oversaturated.
- max-height problems seem to be related to hinting as well as antialias mode. HintingMode should be 1 (no hinting) if AntiAliasMode=2 (subpixel).
- Setting MaxHeight to anything other than 0 effectively sets AntiAliasMode to 0 (256-level).
- FreeType auto-hinting is optimized for use with regular (not subpixel) antialiasing.
- TrueType hinting at medium sizes is optimized for use with antialiasing turned off, and at large sizes with regular (not subpixel) antialiasing.
- FreeType can perform TrueType hinting but this isn't legal in most countries without a license from Apple.
- FreeType's auto-hinting isn't very good. It produces inconsistent stroke widths, and doesn't honor kerning info in the font.
- The interaction between GammaValue, Contrast, and TextTuningR/G/B is hard to grok.
Software incompatibility
- Firefox 3 is not honoring WidthMode=1 for some reason. Firefox 2 works just fine though. I asked one of the developers, Rob O'Callahan, "what changed in Firefox 3?" and he told me:
- "In many situations Firefox 3 uses Uniscribe to compute the position of each character. Maybe GDI++ doesn't cover that? In other situations it calls GetTextExtentPointEx or something. The code is all here, maybe the GDI++ developers can figure out the issue: http://mxr.mozilla.org/mozilla-central/source/gfx/thebes/src/gfxWindowsFonts.cpp They might be able to modify the Firefox 3 code to use GDI++ better and produce a customized build for their users."
- I'm having trouble getting pigfoot's build of Thunderbird to launch message composition windows.
- I've had no luck getting gdippManager.exe and gditray.exe to do anything. They complain about an inability to load a DLL or something.

