Project Proposal: CJK Editing Functionality
Synopsis
This project adds several East Asian (CJK) typesetting features to GIMP's text tool, which provides better experience for artists living in the region, and extends GIMP's possible use cases, e.g. on creating brochures, manga, or educational materials in East Asian languages.
Deliverables
-
fig. Adjustment of inter-character spacing (face tsumegumi,) -
fig. Horizontal-in-vertical setting (tate-chu-yoko,) -
fig. Various line composition rules for puncuation marks (mojikumi,) -
fig. Better punctuation handling by combining Localized Forms ( locl
) with Glyph Composition/Decomposition (ccmp
), -
fig. Hanging punctuation (burasagari), and -
fig. Initial support for Ruby.
Other necessary OpenType features and corresponding user interface implementation may also be introduced.
The text tool should be able to layout the following sentence after this project has been accomplished:
Implementation Details
APIs Related to OpenType Features
Since several items listed in deliverables are either directly or
indirectly based on various OpenType features (e.g. tate-chu-yoko
needs hwid
to work properly in the case of two letters/numbers
combined together,) a text shaping library that supports extensive
OpenType features is needed.
Currently GIMP's text functionalities are mostly based on Pango, a library whose OpenType APIs are already deprecated and superseded by HarfBuzz. Besides, a draft proposed by current text tool maintainer also aims to move away from Pango. These reasons have made HarfBuzz's APIs the better choice to use regarding OpenType features manipulation.
Previous efforts like
!1306 has
already proven that combining APIs in hb-ot.h
with Pango is possible. Its implementation is also a valuable reference
for this project.
User Interface
Commercial software that supports East Asian typesetting features either provides a dedicated panel or list features in drop-down menu, as is shown below:
Adobe Photoshop | Adobe InDesign (Chinese version) |
Since the draft mentioned earlier states that there will possibly be a tremendous change on the whole text tool's user interface, a conservative design may be preferred at this moment. The nature of CJK text editing also suggests that an in-place editing experience is generally better than adjusting parameters on a separate panel.
Therefore, new features will be present mainly in the text tool's pop-up menu, in order to benefit both user experience and possible refactorization in the near future.
Current Problems
An open issue (#325) related to text tool suggests that a cropping problem with text layer's boundary is waiting to be solved. This primarily affects the implementation of burasagari and Ruby, which, in theory, may layout texts outside of its layer boundary.
During the community bonding and coding period, these issues may be further addressed. A possible solution could be similar to !1057 that uses a different constraint to the layer boundary.