diff options
author | Khaled Hosny <khaled@aliftype.com> | 2022-09-22 23:35:12 +0200 |
---|---|---|
committer | خالد حسني <khaled@aliftype.com> | 2022-09-23 12:28:15 +0200 |
commit | 77cce80bb56801acf22da2149bd597d0d7793e3b (patch) | |
tree | f644ff37574a2c1a9bfffec1899a23d24d4d2f9e /vcl/inc/font | |
parent | bdebe856d110700d757625f121879de920b9ef46 (diff) |
vcl: tdf#121327 PDF export for bitmap color fonts
This change extracts the PNG data from the sbix/CBDT tables and embeds
them as PDF Type 3 glyphs. In case the font supports both color layers
and color bitmaps, the color layer take priority.
This also reverts the part of the following commit that allowed bitmap
fonts when creating font subsets because this is not needed now as the
such fonts will now not reach the subsetting code.
commit dcf7792da2aa2a1ef774a124f7b21f68fff0fd15
Author: Khaled Hosny <khaledhosny@eglug.org>
Date: Tue Aug 27 15:19:15 2019 +0200
Make Noto Color Emoji font work on Linux
Change-Id: I350ec97956f37ae574956b22712869fd6d1a6990
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140457
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@aliftype.com>
Diffstat (limited to 'vcl/inc/font')
-rw-r--r-- | vcl/inc/font/PhysicalFontFace.hxx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/vcl/inc/font/PhysicalFontFace.hxx b/vcl/inc/font/PhysicalFontFace.hxx index 5c4ab2eea046..3297feff87dc 100644 --- a/vcl/inc/font/PhysicalFontFace.hxx +++ b/vcl/inc/font/PhysicalFontFace.hxx @@ -67,6 +67,11 @@ public: { } + RawFontData(const RawFontData& rOther) + : mpBlob(hb_blob_reference(rOther.mpBlob)) + { + } + ~RawFontData() { hb_blob_destroy(mpBlob); } RawFontData& operator=(const RawFontData& rOther) @@ -166,10 +171,15 @@ public: bool CreateFontSubset(std::vector<sal_uInt8>&, const sal_GlyphId*, const sal_uInt8*, const int, FontSubsetInfo&) const; + bool IsColorFont() const { return HasColorLayers() || HasColorBitmaps(); } + bool HasColorLayers() const; const ColorPalette& GetColorPalette(size_t) const; std::vector<ColorLayer> GetGlyphColorLayers(sal_GlyphId) const; + bool HasColorBitmaps() const; + RawFontData GetGlyphColorBitmap(sal_GlyphId, tools::Rectangle&) const; + uint32_t UnitsPerEm() const { return hb_face_get_upem(GetHbFace()); } OUString GetName(NameID, const LanguageTag&) const; @@ -184,12 +194,15 @@ public: protected: mutable hb_face_t* mpHbFace; + mutable hb_font_t* mpHbUnscaledFont; mutable FontCharMapRef mxCharMap; mutable vcl::FontCapabilities maFontCapabilities; mutable bool mbFontCapabilitiesRead; mutable std::vector<ColorPalette> maColorPalettes; explicit PhysicalFontFace(const FontAttributes&); + + hb_font_t* GetHbUnscaledFont() const; }; } |