Age | Commit message (Collapse) | Author |
|
Change-Id: I31618b4ae7ea4e37834bffc89e352b4c33eda14d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176372
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
|
|
which allows us to eliminate a bunch of rounding at various layers, and
consequently maintain a lot more precision
Change-Id: I911dedd7c041c1d67396c082e5695346ea689acb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175814
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
and
cid#1616499 COPY_INSTEAD_OF_MOVE
Change-Id: I21b089cab036902a7ba5b725a6eae0f1212f2b31
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171923
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
|
|
Handling EmphasisMarks for direct text rendering
was a hard task - the EmphasisMark stuff is deeply
buried in vcl (would have needed to move quite some
includes from vcl to public) and thus hard to use.
It is also quite old (tools Polygon, Rectangle).
It was missing in the decomposition of the
TextDecoratedPortionPrimitive2D (for good reason),
but is needed now.
I found a way using a callback lambda function to
create the needed geometry in vcl and hand back the
needed data to the caller, in this case to the
decomposition. Adding it to the decomposition of
TextDecoratedPortionPrimitive2D also guarantees
that other renderers/usages will do the correct
thing and all will look identical.
Interestingly EmphasisMarks were never added to
Metafiles (see OutputDevice::ImplDrawEmphasisMarks)
so they were not 'missing' in Metafile-based
exports. But for SDPRs they have to work. I added
another encapsulating TextHierarchyPrimitive to
encapsulate primitives that do represent
EmphasisMarks and added to ignore these in the
VclMetafileProcessor2D (as needed).
Change-Id: I5b5c1528d86a123df2beb57d8366f05aa71e77cf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171826
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
|
|
I have added basic support for the text primitives
(TextSimplePortionPrimitive2D) to the SDPR Cairo
renderer. It can now basically render Text using
a fallback to the already existing CairoTextRender.
NOTE: This is not yet complete, but for discussion.
Change-Id: I9b0c7b6bb4892905576593ef4e2b4071c7663c63
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171429
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
|
|
Change-Id: I07bb67e9384470269d1fd3df087acee377cce729
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166490
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
|
|
Regression from commit cc3663bbaed4f65d64154e5f9abb51a5f622f710
(tdf#160702: improve text positioning, 2024-04-20), where I didn't
know yet that this was possible :-)
Change-Id: I1316db48b8acbacd077eeb4a8989c3dbf7e4a7b5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166425
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
|
|
Opening an SVG with text in different elements (e.g., tspans) in the
same text element performs calculations to position the parts properly
(i.e., the next part will start where the previous part ended, unless
the position in overridden explicitly). These calculations require to
know the text widths. The first problem leas here: the text width was
calculated for a typically small text size (numerically equal to the
pixel size defined in the SVG), but these calculations aren't truly
linear, because font rendering may change depending on font height.
Additionally, the rounding gives much higher error in smaller sizes
than in larger. There was already a workaround for a similar problem
in ViewRedirector::createRedirectedPrimitive2DSequence, where a large
font (with 100 times greater height) was used to increase correctness.
This was also used here, with the same large height (50000) used as a
reference.
Then, at the time of wrawing the text at different zoom levels, the
code in VclProcessor2D::RenderTextSimpleOrDecoratedPortionPrimitive2D
creates a font of a calculated size, and uses it to output the text.
But the font is always created with an integral height, which means,
that for a wanted height of 2.5 (in a zoomed out view), the really
used height will be 3, which is 20% larger; or for wanted height of
2.4, the actual height will be 2 (20% smaller). This resulted in odd
jumps of the text widths, when the text may overlap the following
part, or conversely, create a big gap before the next gap. To try to
mitigate that, the function now takes the difference between the
wanted and the actual font size into account, and adjusts the MapMode
accordingly. This doesn't fix the jumping completely (e.g., because
of the mentioned special handling of small font sizes in the fonts
thenselves, like hinting), but still makes the calculations much more
stable, decreasing the amount of jumping. Similar changes are made in
TextLayouterDevice.
Use of the functions that return text size as a double, not rounded
value, should additionally help improving stability.
Change-Id: I455845d8ca43ee9c06a0fc980947f35d8a25797a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166238
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
|
|
This avoids premature rounding in TextLayouterDevice::getTextBoundRect.
The box in D2DWriteTextOutRenderer::performRender needs to be expanded
to allow room for the line width (which now will be guaranteed on all
sides; previously, the rounding could happen to give no room on some
side, even prior to commit 8962141a12c966b2d891829925e6203bf8d51852).
Fixes some lines partially cut off in smaller text (or zoomed out).
Change-Id: I07335136021f894cf045363b4d736bfab06c64d4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166236
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
|
|
Change-Id: I07255d45bc03a5f86a22d7f392c14053eec7f6ad
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154648
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@libreoffice.org>
|
|
Instead of using a different function to get the character width, use
the same function used for getting the character widths elsewhere.
Change-Id: I21428f34bb0f3a60fa17f5e8ecc3420545356337
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154609
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@libreoffice.org>
|
|
do it like this to avoid adding another mapmode and to keep things
"the same" as much as possible
Change-Id: I1965aa545646f2d27b950d6335b2f608c3e4e04b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143475
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
|
|
Change-Id: I52f24e50455c0d480f8976ee63e442008c05c192
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143520
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
|
|
Communicate Kashida insertion positions in an explicit way.
Rest of LibreOffice communicate adjustments to character widths (e.g.
for justification or spacing) using so-called DX array. DX array is an
array of absolute character positions (e.g. DX[n] is the position after
character n from the start of the lines, and its widths is DX[n] -
DX[n-1]).
This DX array is modified also when Kashidas are inserted after a given
character for Arabic justification, by expanding its width. VCL would
use this to know where to insert the Kashidas and how many ones.
But because DX array is used for both widths adjustments and kashida
insertion, this turns out to be a source of bugs since VCL has tosecond
guess the DX array to find which is pure width adjustment and which also
involves Kashida insertion, and the heuristics it uses are fragile.
This change adds a second array of booleans that records where Kashida
is inserted and communicates it all the way from where Kashida insertion
is decoded in Writer and down to VCL layout.
This change passes the Kashida array only when it seems necessary (e.g.
during drawing but not when measuring text since the DX array is enough
in this case). Hopefully no places where Kashida insertion needs to be
passed down were missed.
A couple of glyph and layout flags that were used for old heuristics and
no longer needed and are removed.
This also fixes:
tdf#87731
tdf#106309
tdf#108604
tdf#112849
tdf#114257
tdf#127176
tdf#145647
tdf#146199
Change-Id: I4ed0850ef2fdc3e9143341afac649e7e7d463c39
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138068
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
|
|
LIBREOFFICE-OWMTGGWJ
Change-Id: I68dfcb0dcbb401c62d4e29f9ab6e4ee1ebc7f072
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130973
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
|
|
Change-Id: Ib89b00c3dc8cd440e8a88906eea133becd1cef64
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125509
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
|
|
Change-Id: Ie2b7a1c74fc516781a17a20157b8217bc41e383d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125504
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
|
|
Makes code simpler, and std::span can be constructed from std::vector
too.
Change-Id: Iae26b53c52148c19d9068a63126a7393d098d654
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124507
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Tested-by: Jenkins
|
|
Change-Id: Id3f037e132a4d07cb2b68dbb93dd24f7f6b33ab6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124461
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: I36ddc11b39763dc77086591fe9bb756195b4294f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124459
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
so we get bounds checking in debug mode
Note that I cannot just pass around the std::vectors
involved because there is a place in editeng which
calls with a subset of a vector.
Change-Id: I5088a139593c27bf9cbe5d843ab4b0048ac6d508
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124330
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
because I'm trying to track down a related heap corruption, and that is
much easier if the access to the array is checked by the std::vector
debug runtime
Change-Id: Ia665f5cebb7f14d88942e88b4b400ad3c28ef5d9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121527
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: I95918275653714577e2d6728dd3947c7fbb66d8f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121360
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
revert commit 8689bd5490b473a7ffb149bbe5f7f0683f679c72
Author: Caolán McNamara <caolanm@redhat.com>
Date: Thu Jul 29 20:49:29 2021 +0100
convert TextAlign to scoped enum
lets leave this as it always was
Change-Id: Id4d2a5644974cdd2b0ed6d361d5c52629674d057
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120626
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
|
|
Change-Id: Id2c466eacb44f0ea6adba75a0ac0be8be8e7ed4c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119682
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
|
|
Move anonymous namespace into drawinglayer::primitive2d and convert
static function into anonymous functions.
Change-Id: Id8ff161a5ec69154f053fadd1178265fa2675139
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106383
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
|
|
Change-Id: Ia80a0331246b4e25cdc3387c50bd97c6befc4ea4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106382
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
|
|
This reverts commit 8891a2fc2a4bf86add68691b7ac167a07a8add84.
Reason: Causes regression, tdf#136891
Revert #2 "-Werror,-Wunused-variable (clang-cl)"
This reverts commit a879b15d59618e73797ad779666f72cd040ff99a.
Reason: Variables are necessary for the other revert.
Change-Id: Ic1c3efe22f5c069f666ea6ba3193612cb44203ca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105620
Tested-by: Jenkins
Reviewed-by: Aron Budea <aron.budea@collabora.com>
|
|
This reverts commit f39e4b6b6f8aa8b4af22b6eb30a52e98cd5a6455.
Reason for revert: Breaks the build on Windows, see e.g.
<https://ci.libreoffice.org//job/lo_tb_master_win/28613/>
> C:/cygwin/home/tdf/lode/jenkins/workspace/lo_tb_master_win/drawinglayer/source/primitive2d/textlayoutdevice.cxx(432): error C2065: 'bFontIsScaled': undeclared identifier
> C:/cygwin/home/tdf/lode/jenkins/workspace/lo_tb_master_win/drawinglayer/source/primitive2d/textlayoutdevice.cxx(438): error C2065: 'nWidth': undeclared identifier
(<https://gerrit.libreoffice.org/c/core/+/104847/1> "Revert 'tdf#127471 Remove
font width scaling hack'" had trivially succeeded to build on Jenkins, as it was
base on the old 8891a2fc2a4bf86add68691b7ac167a07a8add84 "tdf#127471 Remove font
width scaling hack" which it reverted, rather than on recent master.)
Change-Id: I1060e5423f594894b15330ba6631a9af07a64634
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104958
Tested-by: Stephan Bergmann <sbergman@redhat.com>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
|
|
This reverts commit 8891a2fc2a4bf86add68691b7ac167a07a8add84.
Reason for revert: Causes regressions like tdf#136891
Change-Id: I940c447bec38231b666eeac4212f09e22117504e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104847
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
|
|
Change-Id: Ide9811c1a7582454b3fcf655b70ea106ed56509a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104914
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
grepping for stuff in template params this time
Change-Id: Ia37bfd85480b3a72c3c465489581d56ad8dde851
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104855
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
partly to flush some use of "long" out the codebase,
but also to make it obvious which units are being used
for angle values.
Change-Id: I1dc22494ca42c4677a63f685d5903f2b89886dc2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104548
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: I6f5ab6c659a7b6827c1c5f017a740173806504d9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101291
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
|
|
Change-Id: Ic783ab10a3bc2139eef65351d515814374431e59
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101131
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
|
|
Which causes distorted fonts in certain cases (see bug report).
Fix was suggested by Ilhan Yesil at https://bugs.documentfoundation.org/show_bug.cgi?id=127471#c6
Change-Id: Ie644f56f0835ffad9230f981d2927d6b4c17453d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100970
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
|
|
The main reason for the "home-grown" UpCast introduced with
904b3d1fceee5827076758ed2a81f80cb73493ca "Up-cast conversion constructor for
css::uno::Reference" in 2013 was probably that we could not yet rely on C++11
std::is_base_of back then. A (welcome) side effect was that the derived class
could be incomplete.
However, specializations of UpCast relying on whether or not T2 is incomplete
are obviously an ODR violation if the type is incomplete in some TUs and
complete (and derived from T1) in others. And even if UpCast had internal
linkage, it would still be brittle that its behavior depends on the completeness
of T2 at the point of the template's instantiation, and not necessarily at the
point of use.
That means we should better base that ctor on std::is_base_of (which we can do
now since 39a1edd6fec902ef378acce8af42c4d7fba280d0 "Make css::uno::Reference
upcast ctor LIBO_INTERNAL_ONLY"), which causes a compilation error at least on
Clang and GCC if the completeness requirements are not met. This change fixes
all the cases where types need to be complete now, plus any resulting
loplugin:referencecasting warnings ("the source reference is already a subtype
of the destination reference").
Change-Id: Ieb9e3552e90adbf2c5a5af933dcb872e20661a2f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92950
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
|
|
Change-Id: If2644743ab0d9b78d42d1d2fe6fa22c83472d2c1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87065
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: Icccda9c310153e6e1d1696ab094afc3a894d4075
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86298
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
|
|
Found with bin/find-unneeded-includes
Only removal proposals are dealt with here.
Change-Id: I0968cfd6a94c20e6b0d324f068ca658d7d5c0296
Reviewed-on: https://gerrit.libreoffice.org/83294
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
|