summaryrefslogtreecommitdiff
path: root/vcl/inc/fontsubset.hxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-02-08 13:32:40 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-02-09 08:09:12 +0000
commiteecf39c6e44e25a5a78aa7b435d07a9c53c628c4 (patch)
tree605763baadb6ab14ceae1b455cbae4e7890d5bcf /vcl/inc/fontsubset.hxx
parent0e9fbe1db2bb5db6fefbea265dff1b0564bfbb7a (diff)
convert FontType to scoped enum
Change-Id: Ieb8f90be8effde5f25bc872784c3ea2177b14bf9 Reviewed-on: https://gerrit.libreoffice.org/34056 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/inc/fontsubset.hxx')
-rw-r--r--vcl/inc/fontsubset.hxx34
1 files changed, 19 insertions, 15 deletions
diff --git a/vcl/inc/fontsubset.hxx b/vcl/inc/fontsubset.hxx
index 11f58107a5e2..58cdb1e1db71 100644
--- a/vcl/inc/fontsubset.hxx
+++ b/vcl/inc/fontsubset.hxx
@@ -22,35 +22,39 @@
#include <rtl/ustring.hxx>
#include <tools/gen.hxx>
+#include <o3tl/typed_flags_set.hxx>
#include "salglyphid.hxx"
namespace vcl { struct TrueTypeFont; } ///< SFT's idea of a TTF font
+enum class FontType {
+ NO_FONT = 0,
+ SFNT_TTF = 1<<1, ///< SFNT container with TrueType glyphs
+ SFNT_CFF = 1<<2, ///< SFNT container with CFF-container
+ TYPE1_PFA = 1<<3, ///< PSType1 Postscript Font Ascii
+ TYPE1_PFB = 1<<4, ///< PSType1 Postscript Font Binary
+ CFF_FONT = 1<<5, ///< CFF-container with PSType2 glyphs
+ TYPE3_FONT = 1<<6, ///< PSType3 Postscript font
+ TYPE42_FONT = 1<<7, ///< PSType42 wrapper for an SFNT_TTF
+ ANY_SFNT = SFNT_TTF | SFNT_CFF,
+ ANY_TYPE1 = TYPE1_PFA | TYPE1_PFB
+};
+namespace o3tl {
+ template<> struct typed_flags<FontType> : is_typed_flags<FontType, (1<<8)-1> {};
+}
+
class FontSubsetInfo final
{
public:
explicit FontSubsetInfo();
~FontSubsetInfo();
- enum FontType {
- NO_FONT = 0,
- SFNT_TTF = 1<<1, ///< SFNT container with TrueType glyphs
- SFNT_CFF = 1<<2, ///< SFNT container with CFF-container
- TYPE1_PFA = 1<<3, ///< PSType1 Postscript Font Ascii
- TYPE1_PFB = 1<<4, ///< PSType1 Postscript Font Binary
- CFF_FONT = 1<<5, ///< CFF-container with PSType2 glyphs
- TYPE3_FONT = 1<<6, ///< PSType3 Postscript font
- TYPE42_FONT = 1<<7, ///< PSType42 wrapper for an SFNT_TTF
- ANY_SFNT = SFNT_TTF | SFNT_CFF,
- ANY_TYPE1 = TYPE1_PFA | TYPE1_PFB
- };
-
bool LoadFont( FontType eInFontType,
const unsigned char* pFontBytes, int nByteLength );
bool LoadFont( vcl::TrueTypeFont* pSftTrueTypeFont );
- bool CreateFontSubset( int nOutFontTypeMask,
+ bool CreateFontSubset( FontType nOutFontTypeMask,
FILE* pOutFile, const char* pOutFontName,
const sal_GlyphId* pGlyphIds, const sal_uInt8* pEncodedIds,
int nReqGlyphCount, sal_Int32* pOutGlyphWidths = nullptr );
@@ -72,7 +76,7 @@ private:
vcl::TrueTypeFont* mpSftTTFont;
// subset-request details
- int mnReqFontTypeMask; ///< allowed subset-target font types
+ FontType mnReqFontTypeMask; ///< allowed subset-target font types
FILE* mpOutFile;
const char* mpReqFontName;
const sal_GlyphId* mpReqGlyphIds;