mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-23 02:14:50 +00:00
ff608f46fd
Use proper font everywhere for end-of-par marker Fix getColumnNearX for RTL text and for centered/right-justified paragraphs. Let computeRowMetrics update the row width.
46 lines
1.6 KiB
Plaintext
46 lines
1.6 KiB
Plaintext
This branch is where I (jmarc) try to implement string_wise metrics
|
|
computation. This is done through a series of cleanups. The expected
|
|
speed improvement will only be visible at the end of the road: indeed
|
|
for now we intend to keep unchanged behavior for testing purposes.
|
|
|
|
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 using row elements
|
|
|
|
* re-implement 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 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 (can it be done?)
|
|
|
|
* profile and see how performance can be improved.
|
|
|
|
* Document the code
|
|
|
|
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)
|
|
* words longer than the screen are no monger broken at an arbitrary
|
|
point. This is a problem for languages like chinese that do not use
|
|
separators.
|