Smooth font rendering for Japanese characters

The problem is that traditional Japanese fonts (MS Gothic, MS PGothic, MS Mincho…) also include bitmap fonts in small sizes in addition to outline ones (typically for characters 22pt and less). These bitmaps cannot be applied any type of smoothing, so it results in a crazily ugly aliasing, eye hurting appearance. There are several solutions for this:

  • Mactype is an open source replacement (among others, but right now it's the most updated) for Windows font renderer based on FreeType. It will just skip those bitmaps and use the outlines to output smooth characters.

    But currently Mactype cannot emulate DirectDraw calls, so some programs that use DirectDraw/DirectWrite (such as MS office 2013, IE7+, Firefox…) still have aliased fonts, but this is quite rare. On Google Chrome you need to disable DirectWrite to make it work

    Update: The latest Mactype already has better DirectWrite support

    More on this: How To Make Windows Fonts Look Like Mac Fonts

    mactype

  • A better option is stripping all those bitmaps off according to this tutorial. You need some Japanese ability to read it but you can also read the rough translation from Google. The steps to do is quite long so please find it at the end. The result is:

    • No antialiasing with bitmap font (default for Japanese characters less than 23pt)
      アンチエイリアシングなし
    • Cleartype after stripping bitmaps
      ClearTypeを使用
    • Standard antialiasing after stripping bitmaps
      標準アンチエイリアシング
    • No bitmap (outline), no antialiasing
      おまけ

Steps to strip bitmaps from fonts:

  • Copy the fonts files you need to strip, for example msgothic.ttc, from \Windows\Fonts into a folder

  • Download the BREAKTTC tool from MS TrueType SDK

  • Open a command prompt in the folder you copied the fonts to and type BREAKTTC msgothic.ttc. After that you can see all the ttf files in the ttc are extracted as FONT00.ttf ~ FONTxx.ttf

    breakttc

  • Now you to download the FontTools from Microsoft Typography. After that extract the SBIT32 tool which is needed to remove the EBDT (Embedded bitmap data table). The command syntax is as below

    SBIT32 -d <original font file> <metric file> [output file]
    

    You need to run this for each bitmap sizes (typically from 7 to 22) to remove all bitmaps, which is rather clumsy if typing by hand. An automated script would be of great help.

    @echo off
    copy %1 %2 >nul
    for /l %%i in ( 7,1,22 ) do (
        echo PPEM %%i > mtemp.txt
        echo END >> mtemp.txt
        sbit32 -d %2 mtemp.txt ftemp.ttf  
        del %2
        ren ftemp.ttf %2
    )
    del mtemp.txt
    

    Save the above content as rmEBDT.bat and run the following commands (3 for MS Gothic because we have 3 extracted ttf files)

    rmEBDT font00.ttf msgot2.ttf 
    rmEBDT font01.ttf msgotp2.ttf 
    rmEBDT font02.ttf msuigot2.ttf
    
  • Now we have stripped font files, we can rename those font names (which is independent from font file names), like to MS Gothic NB - No Bitmap, to use alongside with the old fonts, or just use the old name and replace the original ttc file, which is a little tricker.
    Either way we need to pack them again to a ttc file in order to install back to Windows. Use the tool MAKETTC which is in the same folder as BREAKTTC or you can also find them here. Run

    MAKETTC <TTC output file name> <TTF file 1> <TTF file 2> ...
    
  • After getting the ttc file, if you have changed the font name you just directly copy them to \Windows\Fonts to register it as a new font and change the default font in UI, apps... to that font. If you want to use the old font name you must boot from another OS like Linux live USB or Windows PE because Windows always load MS Gothic at boot time.


This depends on the font. Different fonts have different characteristics, including different behavior in font smoothing. You might be using a font in the Mincho group, as they are commonly used as default fonts and they may have problems like this; Gothic fonts may work better on screen.


Meiryo, the default Japanese font for Windows Vista/7, as well as some other Japanese fonts contain bitmap (pixel) characters at small sizes.

Going back to your example, I was able to confirm this using Firefox:

  • ClearType (hinted) characters:

    hinted

  • Smaller font-size; bitmap characters:

    bitmap


By default, Firefox uses the following settings for Japanese fonts:

font settings


So, the solution lies in using larger font sizes or replacing the default Japanese font uses in an application with one that supports hinted characters for all sizes (e.g. Arial Unicode).

To globally remap/substitute a font in Windows, you can modify or add Registry values under:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontSubstitutes