Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
82850c93
Kaydet (Commit)
82850c93
authored
May 01, 2012
tarafından
Chr. Rossmanith
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
SVG: use scale in font size and text baseline heuristic
üst
9c9bf9a3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
4 deletions
+20
-4
svgreader.cxx
filter/source/svg/svgreader.cxx
+20
-4
No files found.
filter/source/svg/svgreader.cxx
Dosyayı görüntüle @
82850c93
...
...
@@ -507,8 +507,16 @@ struct AnnotatingVisitor
rtl
::
Reference
<
SvXMLAttributeList
>
xAttrs
(
new
SvXMLAttributeList
()
);
uno
::
Reference
<
xml
::
sax
::
XAttributeList
>
xUnoAttrs
(
xAttrs
.
get
()
);
if
(
XML_TEXT
==
nTagId
)
if
(
XML_TEXT
==
nTagId
)
{
rState
.
mbIsText
=
true
;
basegfx
::
B2DTuple
aScale
,
aTranslate
;
double
fRotate
,
fShearX
;
if
(
rState
.
maCTM
.
decompose
(
aScale
,
aTranslate
,
fRotate
,
fShearX
))
{
rState
.
mnFontSize
*=
aScale
.
getX
();
}
}
std
::
pair
<
StatePool
::
iterator
,
bool
>
aRes
=
mrStates
.
insert
(
rState
);
SAL_INFO
(
"svg"
,
"size "
<<
mrStates
.
size
()
<<
" id "
<<
const_cast
<
State
&>
(
*
aRes
.
first
).
mnStyleId
);
...
...
@@ -1519,18 +1527,26 @@ struct ShapeWritingVisitor
// actually export text
xAttrs
->
Clear
();
// some heuristic attempts to have text output
// baseline-relative
y
-=
2.0
*
maCurrState
.
mnFontSize
/
3.0
;
// extract basic transformations out of CTM
basegfx
::
B2DTuple
aScale
,
aTranslate
;
double
fRotate
,
fShearX
;
if
(
maCurrState
.
maCTM
.
decompose
(
aScale
,
aTranslate
,
fRotate
,
fShearX
))
{
// some heuristic attempts to have text output
// baseline-relative
y
-=
2.0
*
maCurrState
.
mnFontSize
/
aScale
.
getX
()
/
3.0
;
// apply transform
x
*=
aScale
.
getX
();
y
*=
aScale
.
getY
();
x
+=
aTranslate
.
getX
();
y
+=
aTranslate
.
getY
();
}
else
{
// some heuristic attempts to have text output
// baseline-relative
y
-=
2.0
*
maCurrState
.
mnFontSize
/
3.0
;
}
xAttrs
->
AddAttribute
(
USTR
(
"svg:x"
),
rtl
::
OUString
::
valueOf
(
pt2mm
(
x
))
+
USTR
(
"mm"
));
xAttrs
->
AddAttribute
(
USTR
(
"svg:y"
),
rtl
::
OUString
::
valueOf
(
pt2mm
(
y
))
+
USTR
(
"mm"
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment