lyx_mirror/00README_STR_METRICS_BRANCH
Jean-Marc Lasgouttes 6258cebb77 Fix line breaking algorithm
Break words longer than the screen width. The code is more complicated
than I would like, but I have no better idea right now.

Implement properly the notion of a row broken by a display inset. This is useful in different places.

Also fix a bug with last line of a paragraph spotted by Kornel.
2014-06-25 17:55:30 +02:00

52 lines
1.7 KiB
Plaintext

This branch is where I (jmarc) try to implement string_wise metrics
computation. This is done through a series of cleanups. The goal is to
have both good metrics computation (and font with proper kerning and
ligatures) and better performance than what we have with
force_paint_single_char.
Currently everything is supposed to work for LTR text, and RTL text
should work too except possibly metrics with Arabic and Hebrew fonts.
We'll see what to do after some feedback.
What is done:
* Make TextMetrics methods operate on Row objects: breakRow and
setRowHeight instead of rowBreakPoint and rowHeight.
* Change breakRow operation to operate on text strings on which
metrics are computed. The list of elements is stored in the row
object in visual ordering, not logical.
* Re-implement cursorX and getColumnNearX using row elements
* Implement proper string metrics computation (with cache), when
lyxrc.force_paint_single_char is false. In this case, remove also
useless workarounds which disable kerning and ligatures.
Next possible steps:
* Get rid of old code of cursorX and getColumnNearX (which have been
kept for comparison purpose, guarded with KEEP_OLD_METRICS_CODE in
order to check computations).
* Re-implement row painting using row elements. This is not difficult
in principle, but the code is intricate and needs some careful
analysis.
* Profile and see how performance can be improved.
Difference in behavior (aka bug fixes)
* end of paragraph markers metrics are computed with the font of the
actual text, not default font.
* When cursor is after a LTR separator just before a RTL chunk, the
cursor posiiton is computed better with the new code.
Other differences (aka real bugs)
You tell me.