218 Commits
Author SHA1 Message Date
Khaled Hosny 02c7caae9a svgio: font-variation-settings is an inherited property
It is inherited per CSS Fonts, so the children of a group must inherit
it when set on the group.

Change-Id: I3a7f1c58b249e0d647c3b8a15f9e2043b7d6c891
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209212
Reviewed-by: Khaled Hosny <khaled@libreoffice.org>
Tested-by: Jenkins
2026-08-17 22:51:42 +02:00
Karthik 2e4112e55a svg: Correctly import "baseline-shift"
If the `baseline-shift` is a percentage it should be imported relative
to the font-size. Currently it's being imported relative to the parent's
`baseline-shift`

reference: https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Attribute/baseline-shift

Change-Id: I5443e4ce748b423d074e0ca03bb4172607bd52ac
Signed-off-by: Karthik <karthik.godha@collabora.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/3097
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
(cherry picked from commit 0e1af2c9f8e95f14deb0e4643bef90cf98065aa5)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205780
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-05-28 09:28:05 +02:00
Tomaž Vajngerl 03f0efdd07 svgio: fix rendering, which makes SVG images 1px bigger
We added a rectangle using PolygonHairlinePrimitive2D to the
HiddenGeometryPrimitive2D, so we can mark the boundary of the
SVG image. The problem with using the hairline primitive for this
is that the hairline size is grown by 0.5 in each direction
(implGrowHairline, which is called in getB2DRange), which also makes
our SVG size 1px bigger than it should be.

Using FilledRectanglePrimitive2D instead fixes this problem as the
rectangle isn't grown in size.

Also needed to change a lot of tests that were using SVG images
and asserted the size of the image in ome way.

Change-Id: Ic2aa98b3df1f0746e4cfbd3474b6a93d0f4072ea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200440
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
(cherry picked from commit aa2c07951b565cd5464a36a2b0721f888ab8531c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200433
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-05-19 09:28:32 +02:00
Khaled Hosny 1a571fde09 tdf#118792: Add support for font-variation-settings in SVG import
Change-Id: Iaae0426667a3d9357a3c714c6c63f52f79f06706
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203286
Tested-by: Jenkins
Reviewed-by: Khaled Hosny <khaled@libreoffice.org>
2026-04-08 10:09:39 +02:00
Noel Grandin 8459f0be51 XmlWriter::attribute(double) should actually write a double value
And not truncate it to an integer value.

Add additional overload for attribute that takes an enumerated type, otherwise
the compiler will complain about ambiguous conversion because it cannot
choose between the attribute that takes a integral value and the one that
takes a double value.

Change-Id: I9eae22817ec3b26da7b9468d1c8b5e6f3e900538
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201193
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Jenkins
2026-03-10 15:49:17 +01:00
Bartosz Kosiorek 4dccec254c tdf166084 tdf138087 tdf59814 EMF+ Fix scale and trans DrawImagePoints Metafile
This commit fixes the incorrect positioning and scaling of Metafiles
rendered via EMF+ DrawImagePoints.

Key changes:
- Implemented a normalization matrix for Metafiles to properly map
  source coordinates (SrcRect) to the destination.
- Updated EMFPImage to parse and store bounds from nested EMF headers,
  ensuring correct dimensions (x, y, width, height) are available.

Change-Id: I07b4d99c334611a10e7faff42b76699f04fa1520
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201084
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2026-03-06 22:13:37 +01:00
Gabor Kelemen 0bdcfc2900 tdf#146619 Use more forward declarations in include/unotools/
This shaves off some 40M of input

Change-Id: I12e10deb87ceea1f7a23f3de4ea624befe187c3f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198238
Reviewed-by: Gabor Kelemen <gabor.kelemen@collabora.com>
Tested-by: Jenkins
2026-02-05 17:35:46 +01:00
Xisco Fauli 99d19aebd3 tdf#168372: remove surrounding apostrophes in font-family
Change-Id: I94ef4ae8aa5aa7aa27602e959f80eb17c83679ce
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197864
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-01-23 11:32:59 +01:00
Caolán McNamara 50b4e6d6b4 drop CJK text from systemLanguage switch example
because we run this test with set_non_application_font_use=abort so we
don't expect any glyph substitution, and the default setup is without
any bundled Japanese font.

Change-Id: I2e7ead7404fbacb768c06502a52cde629c1a1116
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195407
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2025-12-12 10:41:46 +01:00
Caolán McNamara 4dca59d904 don't tack on a extra null byte at the end of the stream
Change-Id: I8fa54a6f8a69f4cbed1bf899ba0781096198ef81
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195403
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2025-12-11 09:54:26 +01:00
Xisco Fauli f127f708f6 tdf#168452: support unicode-bidi in svg
Before this change, getBiDiStrong() was never used
to manipulate the text

Change-Id: I9d6a2e8b79d27126902f2be84174c641ec71c28c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191123
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2025-09-18 16:34:18 +02:00
Xisco Fauli 4d9a323a83 tdf#168378: invert text anchor in RTL
Change-Id: Ia9b7e526ab20cbcdb521f965a5a2dc0726894209
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191018
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2025-09-16 15:28:30 +02:00
Xisco Fauli 4efae74abc tdf#168421: support RTL text direction in svg
Change-Id: Iba8853d131bf88be3cc94003a73ffe545cf62004
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190978
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2025-09-15 22:39:35 +02:00
Noel Grandin 6d0e5ddede remove BitmapEx
all use-sites have been converted to Bitmap

Change-Id: I1a8842217a266eef100bd387ab013b004e532256
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190618
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2025-09-05 19:45:45 +02:00
Armin Le Grand (collabora) ba462658d9 tdf#168002 CairoSDPR breaks SVG text layout
SubpixelPositioning was until now activated when *any* MapMode was set,
but there is another case this is needed: When a TextSimplePortionPrimitive2D is rendered by a SDPR.

In that case a TextLayouterDevice is used (to isolate all Text-related
stuff that should not be at OutputDevice) combined with a 'empty'
OutDev -> no MapMode.

The DXArray for Primitives (see that TextPrimitive) is defined in the
Unit-Text_Coordinate-System, thus in (0..1) ranges. That allows to
have the DXArray transformation-independent and thus re-usable and
is used since the TextPrimitive was created.

If there is a DXArray missing at the text Primitive (as is the case
with SVG imported ones, but allowed in general) one gets automatically
created during the SalLayout creation for rendering. Unfortunately there
(see GenericSalLayout::LayoutText, usages of GetSubpixelPositioning) the
coordinates get std::round'ed, so all up to that point correctly
calculated metric information in that double-precision dependent coordinate space gets *shredded*.

To avoid that, SubpixelPositioning  has to be activated. While this
might be done in the future for all cases (SubpixelPositioning ==
true), for now add this case for all usages of TextLayouterDevice to
not break old stuff.

NOTE: Due to higher precision I had to adapt some values for SVGIO
tests: That is expected since higher precision leads to less-wide
results internally. I checked testdocs that deviations are minimal and
have better quality with SubpixelPositioning then before.

Change-Id: Iab5aa6336cdb18224fd06472bf6badc9eb0fce3a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189993
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
Tested-by: Jenkins
2025-08-26 10:45:00 +02:00
Xisco Fauli 42e566654a tdf#167147: Support transparent fill color
Change-Id: I5a38a52f2720f58bc2762d328fb6a5e4090c6dde
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186780
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2025-06-21 16:17:43 +02:00
Xisco Fauli 1ad1b3e833 tdf#164434: svgio: Add unittest
Change-Id: Id66f344c785f1771debcc8bd2e09c8a04da4c989
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180165
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2025-01-13 12:26:17 +01:00
Mike Kaganski a6a6921123 Use good old string literals in assertXPath and friends
These are only sent to an external API expecting char*-like strings,
or for comparison. Having every assertXPath having three of _[ou]str
is too much syntactic noise, making the unit tests almost unreadable.

Change-Id: Ic004a36ea75e7bfe0b96f405c40f926a957b51cc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174416
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2024-10-05 10:06:44 +02:00
Xisco Fauli 16684eb4ba tdf#163212: context-fill/context-stroke can also use gradients
Change-Id: Ic6f7f5e0817d8f5fccee64938004aa899bde47dc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174382
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2024-10-02 14:31:47 +02:00
Balazs Varga b6775ce2b3 Temporarily skip unit tests on native arm64 build
which indicating unit test fails.

Change-Id: I2689b0dda888e15e52ca60cc18e1705a1aefe968
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173143
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>
Tested-by: Jenkins
2024-09-12 09:37:26 +02:00
Armin Le Grand (Collabora) 45c45e97e1 CairoSDPR: make use of RGBA PolyPolygon in more cases
Change-Id: I7cd93e5452bce96eef295c766f4cb391ddd67250
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170792
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
Tested-by: Jenkins
2024-07-20 19:31:36 +02:00
Xisco Fauli 8c5f93ee35 tdf#161985: getOpacity is also called from other places
Partially revert 56039daae4
"tdf#149673: only check opacity from parent..." to make
getOpacity behave as before and move the new behaviour
of getOpacity inside add_postProcess

Change-Id: If475cddbc4967308fa06adacda621cb3790c6f70
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170376
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2024-07-11 17:09:43 +02:00
Xisco Fauli 1a7c927f6f tdf#161213: fill can use context-stroke and vice versa
Change-Id: Id127bd4943ff1b67915d1de3ba4fcf93dab21423
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168774
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-06-13 14:47:33 +02:00
Noel Grandin 75111c745a loplugin:ostr in svgio
Change-Id: I9869f8558a69d5a6b6ac3165c627b943c00e787e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167653
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2024-05-15 12:53:22 +02:00
Xisco Fauli 3b0f96a077 tdf#155651: Add support for "context-fill"
Change-Id: I6f96cc7c059ece5f9401fc0ae552cf279e53109c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167230
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2024-05-06 22:02:01 +02:00
Xisco Fauli d75a37a582 tdf#155651: Add support for "context-stroke"
Change-Id: Ib4f4a7b644d0d6c6b36e31b80fd7adc18999110d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167024
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-05-03 11:50:42 +02:00
Xisco Fauli 99757f5e3a CppunitTest_svgio: fix mid-air collision
it was caused by 98935eef13
"tdf#159661, tdf#160773: svgio: Add unittest"
and 7f64148507
"Fix a thinko in 8a97f1ba8d9ccb65b2c89106de20666311d90c30"

This partially reverts d984836834
"Fix unit test after commit 98935eef13c7d755221d79fe7d3c5869a40a7c37"

Kudos to Mike for keeping Jenkins happy

Change-Id: I034759b2cd95cbaaeb84ec1b528bf5b61487a1e0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166591
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-04-25 09:21:03 +02:00
Mike Kaganski d984836834 Fix unit test after commit 98935eef13
Similar to commit cfa9990d47 (Enable
this test on all platforms. 2024-04-20), it seems that 'mask' gets
exported inconsistently. This patch workarouns the problem; a proper
fix would be finding the real cause.

Change-Id: I94c89442aa0385262fba67ec58c9d8d12ffbea27
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166573
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-04-24 09:43:30 +02:00
Xisco Fauli 98935eef13 tdf#159661, tdf#160773: svgio: Add unittest
Change-Id: I2d0b96f13e02ac81b97ea347889c76770c22a989
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166509
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-04-23 14:05:04 +02:00
Xisco Fauli 851f60697d tdf#159660: also add normal blend filter
Change-Id: I3edc7495975618357f002536857a11dcc72cc0b9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166460
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-04-22 18:43:08 +02:00
Xisco Fauli 1097686ebd tdf#160782: convert to bitmapEx from 0,0 to width,height
This is the way it's done everywhere.
Partially revert 4b6e0f2c88
"tdf#160726, tdf#48062: Simplify how BitmapExs are created"

Change-Id: I15fea0b6855a65da7cb48b24fc00ba303e33dcf8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166456
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-04-22 17:38:15 +02:00
Xisco Fauli 41368edc6e tdf#159660: Add support for lighten mode in feBlend
Change-Id: I17471a9c70a38d05de5ad476f817285fb2438e5a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166429
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-04-22 15:20:16 +02:00
Xisco Fauli a9f1b70527 tdf#159660: Add support for darken mode in feBlend
Change-Id: I56862163b7bf1177120081c95ab7851a5fc4019b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166428
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-04-22 14:55:44 +02:00
Xisco Fauli fdf3027a0e tdf#159660: Add support for multiply mode in feBlend
Change-Id: I03230e122a10dd6ada6af357c674c278b6b99d9e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166427
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-04-22 14:55:37 +02:00
Xisco Fauli 357e390be4 tdf#159660: premultiply colors for screen blend
This is needed after 4b6e0f2c88
"tdf#160726, tdf#48062: Simplify how BitmapExs are created"
Otherwise, only the common area is displayed

Change-Id: I40c798380049e62df8729c4acdb5db50d988d8e1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166426
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-04-22 13:31:44 +02:00
Xisco Fauli 4b6e0f2c88 tdf#160726, tdf#48062: Simplify how BitmapExs are created
In my initial approach, I tranformed the primitive2DContainers
before converting them to BitmapEx. This caused circles like
https://bugs.documentfoundation.org/attachment.cgi?id=193790
not to be displayed.
Simplify how BitmapExs are created by just using the range both
primitive2DContainers have in common. This way, DrawBitmapInRect
can be dropped now

Change-Id: I2401dc87b98e04b9cf9f5ebade2b5622d884fc3a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166391
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-04-22 11:53:41 +02:00
Mike Kaganski 6e6081b340 tdf#157103: fix SVG whitespace handling
Previous code tried to hack some tricks to restore whitespaces after
trimming them according to the xml:space attribute value. But it was
wrong in multiple ways.

1. The collapsed space must stay in the block where its start was.
   When a block ended with a space, then trimming the space from it,
   and adding to a next block, can change the size of the space.
2. The shift of a line (e.g., specifying x and y values) doesn't end
   the logical line. A space before such a shift must be kept by the
   same rules, as if there weren't a shift.
3. A block with xml:space="preserve" is treated as if it consists of
   all non-whitespace characters, even if its leading or trailing
   characters are spaces. I.e., a trailing space in a block before,
   or a leading space in a block after, should be collapsed into a
   single space, not removed - even when the space-preserving block
   itself is made invisible.

Change-Id: Ic778d1e9d6b9d0c342ea74ad78d44bb47bc8d708
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166239
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-04-20 12:16:08 +02:00
Mike Kaganski cc3663bbae tdf#160702: improve text positioning
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>
2024-04-20 11:28:34 +02:00
Xisco Fauli 7e0b8e74dd svgio: remove duplicated assertXPathDouble
Change-Id: I82c4abc6883d292114b4239efee60aee082357fc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166307
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-04-20 08:55:18 +02:00
Xisco Fauli 01479c742f tdf#160721: nothing is displayed in case of wrong 'in' reference
Change-Id: I746ec8a12dba7832241693dac7f20788a2fa85bb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166267
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-04-19 09:08:25 +02:00
Mike Kaganski 2642643ec0 tdf#160622: Let SalLayout::GetBoundRect return basegfx::B2DRectangle
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 8962141a12).
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>
2024-04-19 05:31:51 +02:00
Mike Kaganski edef46e82e tdf#160717: fix ex handling
Same as in commit e275726861
(tdf#160593: make sure to use current element's font size for em unit,
2024-04-18) for em.

Change-Id: Id9003c0426a6b373456da1aa1550f7ff07f766a3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166235
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-04-19 05:18:50 +02:00
Mike Kaganski 86a8a3a43b tdf#160594: Use the recommended fallback of 0.5em for ex in font-size
This fixes the error of identical treatment of em and ex in font-size,
which violated https://drafts.csswg.org/css-values-4/#font-relative-length.
The fix uses the fallback of 0.5em for ex, similar to the code used in
SvgNumber::solveNonPercentage. A follow-up should implement the correct
use of "x-height of the first available font".

Change-Id: Id9d581994e158d629d9752299ad93ac7e9fe4cad
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166234
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-04-18 18:21:15 +02:00
Mike Kaganski e275726861 tdf#160593: make sure to use current element's font size for em unit
According to https://drafts.csswg.org/css-values-4/#font-relative-length
em is "equal to the computed value of the font-size property of the element
on which it is used". This means, that for an element that defines its own
font-size, attributes like 'dy' using em refer to the new font-size, not to
inherited font-size.

Change-Id: Ie5a013df99a68edddf466e4c0ee5311f6219fcb2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166233
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-04-18 18:21:09 +02:00
Mike Kaganski 1f1f423200 Round in XmlWriter::attribute when passing a double
Before, it truncated. Rounding provides a closer value.

Change-Id: I213e6ae34ada2f5081cb2c8b2ef431448c712b37
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165947
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-04-14 15:13:10 +02:00
Xisco Fauli 0a2535ceb0 tdf#160386: Add support for switch element
For now, only use language tag, meaning if
there is a file like in the unittest with

<text systemLanguage="en-us">Howdy!</text>
<text systemLanguage="en-gb">Wotcha!</text>
<text systemLanguage="en-au">G'day!</text>
<text systemLanguage="en">Hello!</text>

"Hello!" with be displayed in a en_AU system locale

This patch partially reverts 13a41e7a12
"tdf#150124: do nothing when parent is of unkown type"
making 0dfd8288a8
"ofz#60384 Direct-leak" no longer necessary

Change-Id: Ifc73bc69aa997088dc0a2b11d7d30446303fa3b3

Change-Id: I885ef0f2c44b86196881fe55a963db2e5c7eb1be
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165394
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-03-27 23:44:40 +01:00
Xisco Fauli 6b15374d18 tdf#156579: svgio: Add unittest
Change-Id: I77ab0c72209fa02c6e463351e8cda09213d47ac3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165399
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-03-27 22:03:09 +01:00
Xisco Fauli 7fa2a81f2f CppunitTest_svgio: factor out common code
Change-Id: I5171a07d9015706a89f25b0c2805ebed8444260d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165401
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-03-27 20:46:03 +01:00
Xisco Fauli feb4e0890b tdf#160373: Iterate over all parents to check whether it's a clipPath content
Change-Id: I383ec264e4c88ebcee2ae6a839b762bba8abfc12
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165347
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-03-26 18:38:59 +01:00
Xisco Fauli 4e9b39aefb tdf#48062: Add support for atop operator in feComposite
Change-Id: Ifb83b4361d37566d189a7c5b11835f2a5e0eecc2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164862
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-03-15 13:30:40 +01:00