https://bugzilla.wikimedia.org/show_bug.cgi?id=63122

            Bug ID: 63122
           Summary: improve detectTofu algorithm so it can detect
                    replacement characters in fixed-width glyphs
           Product: MediaWiki extensions
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: Unprioritized
         Component: UniversalLanguageSelector
          Assignee: wikibugs-l@lists.wikimedia.org
          Reporter: da...@sheetmusic.org.uk
                CC: alolita.sha...@gmail.com,
                    amir.ahar...@mail.huji.ac.il, da...@sheetmusic.org.uk,
                    kartik.mis...@gmail.com, niklas.laxst...@gmail.com,
                    pgi...@wikimedia.org, run...@gmail.com,
                    santhosh.thottin...@gmail.com,
                    sucheta.ghos...@gmail.com
       Web browser: ---
   Mobile Platform: ---

The detectTofu function finds glyphs which are missing from a font (and so are
replaced by a replacement character or "tofu").

The current algorithm works as follows:

1. Measure the rendered width/height of each character in a test string.
2. Compare to a character that is known to be replaced.
3. If each character is the same size (including the replacement), then
conclude that all characters are missing glyphs.

This works very well for many languages. However, it fails for Chinese, because
typically all Han character glyphs in a font are the same size as the
replacement character glyph. Also, there is no such thing as a 'complete Han
font': there are always missing characters.

Therefore, we should implement a more sophisticated approach:

1. Start with the above algorithm for speed.
2. Render a character to an HTML canvas.
3. Compare its bitmap to the bitmap of the replacement character glyph.

This will allow us to detect exactly which characters are missing, regardless
of width/height.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to