Skip to content

Instantly share code, notes, and snippets.

@cqjjjzr
Last active February 19, 2023 16:47
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save cqjjjzr/1af5f3bca1d71bf188b3d2e73d9c1b94 to your computer and use it in GitHub Desktop.
Final Report for GSoC 2022 Project: Improve FreeType demo program ftinspect

Final Report for GSoC 2022 Project: Improve FreeType demo program ftinspect

Final Work Submission

Updated Notes

  • 2023/2/9: The updated version of ftinspect has been released with FreeType 2.13.0! Thanks for all you guys!!

Project Basic Information

Code and Organization

  • Dev branch: gsoc-2022-chariri-3 (commit history, tree)
  • Wrapping-up branch (rebase to latest master, organize commits and clean-up): gsoc-2022-chariri-final (commit history, tree)

Project Description

ftinspect is a tool for inspecting how fonts are rendered with FreeType. In this project, the tool is integrated with functionalities from other FreeType demo tools including ftgrid, ftview, ftstring, ftdiff, ftmulti and ftdump. The tool was converted from a bare skeleton with limited function from ftgrid to a comprehensive font and engine inspector, which allows adjusting for a wide range of rendering parameters and viewing the font in multiple views including checking the bitmap in a grid view, displaying strings rendered by FreeType, comparing different rendering parameters side-by-side, etc.

Major tasks completed:

  • Improved "Singular Grid View" (from ftgrid): Inspecting the bitmaps and (if available) outlines in an enlarged grid view. This was the only function in the original ftinspect tool. The project introduces GUI improvement to this view. Auxiliary lines showing several font metrics are added.

  • New "Continuous View" (from ftstring and ftview): Displaying strings or all glyphs in a continuous manner. Fancy rendering (emboldened and slanting), stroked and waterfall modes are supported.

  • New "Comparator View" (from ftdiff): Compare different sets of parameters side-by-side.

  • New "Font Info" (from ftdump): Showing information for the font file including metadata, basic metrics, charmaps, SFNT tables, etc. Two functions absent from the ftdump tool are implemented: showing mapping between SFNT tables and subfaces for TrueType Collections font files; showing composite glyphs tree;

  • More parameters implemented: Only hinting and several anti-aliasing settings were supported in the original ftinspect tool. This project adds implementation for gamma correction, back/foreground color, embedded bitmaps, color layers, LCD anti-aliasing, and MM/GX axes (from ftmulti).

  • Major UI/UX improvement: A much more intuitive GUI is introduced. Remarkable points include:

    • Scroll operations in grid and continuous view can zoom the view, adjust the size. Drag operation in the continuous view can move the string (if in string mode), or adjust the glyph index (if showing all glyphs).
    • The user can click on the glyphs in the continuous view to get detailed information about them, like glyph index and metrics. Right-clicking will bring the user to the singular grid view showing the clicked glyph.
    • Dropping files on the window will open them.
    • The original design to navigate between fonts, faces and VF named instances is 6 buttons ("Previous" and "Next" for each). The project rewrites the selector to 3 checkboxes at the bottom of the window, making the navigation markedly more intuitive.
    • Tooltips are added for most GUI widgets as documentation.
  • Finer representation for data: Better translation of original values from the FreeType library is provided. For example, charmap encoding are represent as names instead of simply tags. The same applies for platforms and languages, etc.

Screenshots

Before

pic_old.png

After

pic1_grid.png

pic2_continuous.png

pic3_mmgx.png

pic4_color.png

pic5_comparator.png

pic6_info.png

pic7_composite.png

Next Steps

Here is a list of possible additions that haven't been implemented:

  • SVG glyphs rendering
  • Full command-line support
  • Automation and automated testing support
  • Testing and Benchmark for fonts (ftlint and ftbench)

Acknowledgement

I'd like to express my deepest gratitude to all FreeType mentors and community members who provided enormous help. It was the guidance, suggestions, feedbacks and reviews from Werner, Suzuki, Alexei and other community member that make my GSoC experience possible, remarkable and smooth.

It's delightful that my skills were greatly extended during the project, and my understanding for font rendering is significantly deepened.

Cheers,
Charlie Jiang

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment