diff options
author | Kevin Suo <suokunlong@126.com> | 2022-01-29 21:44:36 +0800 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-02-04 07:44:18 +0100 |
commit | bcf10015c5d12d363d0be9f6da25092c83112692 (patch) | |
tree | ea387afc1bb6029e32828c42c9048deec5dd132f /sdext/source/pdfimport/wrapper | |
parent | 2f605009907166d509ccd1dcb6385e5cd456e3e4 (diff) |
sdext.pdfimport tdf#137128: Recognize more font name and weight...
...values from the embeded 'PS' font names.
Change-Id: I8465a6b1d845ce626848112f0a735a9ee3696e5c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129136
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sdext/source/pdfimport/wrapper')
-rw-r--r-- | sdext/source/pdfimport/wrapper/wrapper.cxx | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/sdext/source/pdfimport/wrapper/wrapper.cxx b/sdext/source/pdfimport/wrapper/wrapper.cxx index 0560826d5727..cfa256f0acfa 100644 --- a/sdext/source/pdfimport/wrapper/wrapper.cxx +++ b/sdext/source/pdfimport/wrapper/wrapper.cxx @@ -492,7 +492,15 @@ void LineParser::parseFontFamilyName( FontAttributes& rResult ) { rResult.familyName = rResult.familyName.replaceAll(fontAttributesSuffix, ""); SAL_INFO("sdext.pdfimport", rResult.familyName); - if (fontAttributesSuffix == u"Bold") + if (fontAttributesSuffix == u"Heavy" || fontAttributesSuffix == u"Black") + { + rResult.fontWeight = u"900"; + } + else if (fontAttributesSuffix == u"ExtraBold" || fontAttributesSuffix == u"UltraBold") + { + rResult.fontWeight = u"800"; + } + else if (fontAttributesSuffix == u"Bold") { rResult.fontWeight = u"bold"; } @@ -500,10 +508,26 @@ void LineParser::parseFontFamilyName( FontAttributes& rResult ) { rResult.fontWeight = u"600"; } + else if (fontAttributesSuffix == u"Medium") + { + rResult.fontWeight = u"500"; + } + else if (fontAttributesSuffix == u"Normal" || fontAttributesSuffix == u"Regular" || fontAttributesSuffix == u"Book") + { + rResult.fontWeight = u"400"; + } else if (fontAttributesSuffix == u"Light") { rResult.fontWeight = u"300"; } + else if (fontAttributesSuffix == u"ExtraLight" || fontAttributesSuffix == u"UltraLight") + { + rResult.fontWeight = u"200"; + } + else if (fontAttributesSuffix == u"Thin") + { + rResult.fontWeight = u"100"; + } if ( (fontAttributesSuffix == "Italic") or (fontAttributesSuffix == "Oblique") ) { |