2014-03-03 14:29:37 +00:00
|
|
|
|
|
|
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
|
|
PLEASE DO NOT DO WORK ON TOP OF THIS BRANCH.
|
|
|
|
I INTEND TO REWRITE HISTORY LATER!!!
|
|
|
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
|
|
|
|
|
|
This branch is where I (jmarc) try to implement string-wise metrics
|
|
|
|
computation. 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. Moreover there has been
|
|
|
|
some code factorization in TextMetrics, where the same row-breaking
|
|
|
|
algorithm was basically implemented 3 times.
|
2013-07-23 14:24:01 +00:00
|
|
|
|
2014-04-30 14:15:31 +00:00
|
|
|
Currently everything is supposed to work for both LTR and RTL text.
|
2014-03-03 14:29:37 +00:00
|
|
|
|
2014-05-12 09:02:22 +00:00
|
|
|
The bugs fixed and caused by this branch are tracked at ticket #9003:
|
|
|
|
http://www.lyx.org/trac/ticket/9003
|
2013-06-18 08:18:32 +00:00
|
|
|
|
|
|
|
What is done:
|
2013-07-23 14:24:01 +00:00
|
|
|
|
2013-06-18 08:18:32 +00:00
|
|
|
* Make TextMetrics methods operate on Row objects: breakRow and
|
2013-06-25 06:18:25 +00:00
|
|
|
setRowHeight instead of rowBreakPoint and rowHeight.
|
|
|
|
|
2014-03-03 14:29:37 +00:00
|
|
|
* Change breakRow operation to operate at strings level to compute
|
|
|
|
metrics The list of elements is stored in the row object in visual
|
|
|
|
ordering, not logical. This will eventually allow to get rid of the
|
|
|
|
Bidi class.
|
2013-06-25 06:18:25 +00:00
|
|
|
|
2013-12-20 13:02:31 +00:00
|
|
|
* rename getColumnNearX to getPosNearX (and change code accordingly).
|
|
|
|
It does not make sense to return a position relative to the start of
|
|
|
|
row, since nobody needs this.
|
|
|
|
|
|
|
|
* Re-implement cursorX and getPosNearX using row elements.
|
2013-07-21 18:22:32 +00:00
|
|
|
|
2014-05-14 13:36:44 +00:00
|
|
|
* Do not honor lyxrc.force_paint_single_char anymore. This is a
|
|
|
|
workaround that is not necessary anymore.
|
|
|
|
|
|
|
|
* Implement proper string metrics computation (with cache). Remove
|
2013-07-21 18:22:32 +00:00
|
|
|
useless workarounds which disable kerning and ligatures.
|
2013-06-18 08:18:32 +00:00
|
|
|
|
2014-05-14 13:36:44 +00:00
|
|
|
* Draw also RtL text string-wise. This both speeds-up drawing and
|
|
|
|
prepares for code removal, since we now rely on Qt to do things we
|
|
|
|
use to do by ourselves (see isArabic* and isHebrew* code in
|
|
|
|
Encodings.cpp).
|
2013-06-25 06:18:25 +00:00
|
|
|
|
2014-05-02 13:03:20 +00:00
|
|
|
* Do not cut strings at separators in RowPainter when text is not
|
|
|
|
justified. This speeds-up painting by reducing the number of strings
|
|
|
|
to draw.
|
2013-10-11 14:12:20 +00:00
|
|
|
|
|
|
|
|
2014-05-02 13:03:20 +00:00
|
|
|
Next steps:
|
2014-03-03 14:29:37 +00:00
|
|
|
|
2014-05-12 09:02:22 +00:00
|
|
|
* Fix bugs uncovered by testing.
|
2014-03-03 14:29:37 +00:00
|
|
|
|
2014-05-14 13:36:44 +00:00
|
|
|
* Get rid of LyXRC::force_paint_single_char, which is not used anymore
|
|
|
|
in the source.
|
2014-05-12 09:02:22 +00:00
|
|
|
|
|
|
|
* Maybe get rid of LyXRC::rtl_support, which does not have a real use case.
|
2013-06-25 06:18:25 +00:00
|
|
|
|
2014-03-03 14:29:37 +00:00
|
|
|
* Profile and see how performance can be improved.
|
|
|
|
|
|
|
|
|
|
|
|
Steps for later (aka out of the scope of this branch):
|
|
|
|
|
2013-07-23 14:24:01 +00:00
|
|
|
* Re-implement row painting using row elements. This is not difficult
|
|
|
|
in principle, but the code is intricate and needs some careful
|
2014-03-03 14:29:37 +00:00
|
|
|
analysis. The first thing that needs to be done is to break row
|
2014-03-21 10:56:42 +00:00
|
|
|
elements with the same criteria. Currently breakRow does not
|
|
|
|
consider on-the-fly spell-checking and selection changes, but it is
|
|
|
|
not clear to me that it is required. Moreover, this thing would only
|
|
|
|
work if we are sure that the Row object is up-to-date when drawing
|
|
|
|
happens. This depends on the update machinery.
|
2013-06-25 06:18:25 +00:00
|
|
|
|
2014-05-12 09:02:22 +00:00
|
|
|
This would allow to get rid of the Bidi.cpp code.
|
2013-07-17 22:25:08 +00:00
|
|
|
|
2013-07-23 14:24:01 +00:00
|
|
|
|