2013-06-18 08:18:32 +00:00
|
|
|
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
|
2013-06-25 06:18:25 +00:00
|
|
|
setRowHeight instead of rowBreakPoint and rowHeight.
|
|
|
|
|
2013-06-18 08:18:32 +00:00
|
|
|
* change breakRow operation to operate on text strings on which
|
2013-06-25 12:57:09 +00:00
|
|
|
metrics are computed. The list of elements is stored in the row object
|
2013-07-16 22:59:34 +00:00
|
|
|
in visual ordering, not logical.
|
2013-06-25 06:18:25 +00:00
|
|
|
|
2013-07-17 22:25:08 +00:00
|
|
|
* re-implement cursorX using row elements
|
|
|
|
|
2013-07-21 18:22:32 +00:00
|
|
|
* re-implement getColumnNearX using row elements (boundary is not
|
|
|
|
considered yet).
|
|
|
|
|
2013-06-25 06:18:25 +00:00
|
|
|
* Implement proper string metrics computation (with cache), when
|
2013-07-21 18:22:32 +00:00
|
|
|
lyxrc.force_paint_single_char is false. In this case, remove also
|
|
|
|
useless workarounds which disable kerning and ligatures.
|
2013-06-18 08:18:32 +00:00
|
|
|
|
|
|
|
Next steps:
|
2013-06-25 06:18:25 +00:00
|
|
|
|
2013-07-17 22:25:08 +00:00
|
|
|
* get rid of old code of cursorX and getColumnNearX (which have been
|
2013-07-21 18:22:32 +00:00
|
|
|
kept for comparison purpose, guarded with KEEP_OLD_METRICS_CODE).
|
2013-06-25 06:18:25 +00:00
|
|
|
|
|
|
|
* re-implement row painting using row elements (can it be done?)
|
|
|
|
|
2013-06-18 08:18:32 +00:00
|
|
|
* profile and see how performance can be improved.
|
|
|
|
|
2013-07-17 22:25:08 +00:00
|
|
|
* Document the code
|
|
|
|
|
2013-06-18 08:18:32 +00:00
|
|
|
Difference in behavior
|
|
|
|
* end of paragraph markers metrics are computed with the font of the
|
2013-07-16 22:59:34 +00:00
|
|
|
actual text, not default font. This will be extended to the other
|
|
|
|
methods.
|
2013-06-18 08:18:32 +00:00
|
|
|
|
2013-07-17 22:25:08 +00:00
|
|
|
* When cursor is after a LtR separator just before a RtL chunk, the
|
|
|
|
cursor posiiton is computed better with the new code.
|
|
|
|
|
2013-06-25 12:57:09 +00:00
|
|
|
Other differences that should be considered as bugs
|
2013-07-16 22:59:34 +00:00
|
|
|
* 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.
|
2013-07-21 18:22:32 +00:00
|
|
|
|
|
|
|
* Boundary is not taken in account properly in getColumnNearX
|