bump product version to 6.3.0.0.beta1
[LibreOffice.git] / include / unotools / fontdefs.hxx
blob7a8bf90d7c4f2150c805293b7039b33028cf35b0
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef INCLUDED_UNOTOOLS_FONTDEFS_HXX
20 #define INCLUDED_UNOTOOLS_FONTDEFS_HXX
22 #include <unotools/unotoolsdllapi.h>
23 #include <sal/types.h>
24 #include <rtl/ustring.hxx>
25 #include <o3tl/typed_flags_set.hxx>
27 enum class SubsFontFlags
29 ONLYONE = 0x01,
30 MS = 0x02
33 namespace o3tl
35 template<> struct typed_flags<SubsFontFlags> : is_typed_flags<SubsFontFlags, 0x03> {};
38 UNOTOOLS_DLLPUBLIC OUString GetSubsFontName( const OUString& rName, SubsFontFlags nFlags );
40 UNOTOOLS_DLLPUBLIC void AddTokenFontName( OUString& rName, const OUString& rNewToken );
43 class UNOTOOLS_DLLPUBLIC ConvertChar
45 public:
46 const sal_Unicode* mpCvtTab;
47 const char* mpSubsFontName;
48 sal_Unicode (*mpCvtFunc)( sal_Unicode );
49 sal_Unicode RecodeChar( sal_Unicode c ) const;
50 void RecodeString( OUString& rStra, sal_Int32 nIndex, sal_Int32 nLen ) const;
51 static const ConvertChar* GetRecodeData( const OUString& rOrgFontName, const OUString& rMapFontName );
55 enum class DefaultFontType
57 SANS_UNICODE = 1,
58 SANS = 2,
59 SERIF = 3,
60 FIXED = 4,
61 SYMBOL = 5,
62 UI_SANS = 1000,
63 UI_FIXED = 1001,
64 LATIN_TEXT = 2000,
65 LATIN_PRESENTATION = 2001,
66 LATIN_SPREADSHEET = 2002,
67 LATIN_HEADING = 2003,
68 LATIN_DISPLAY = 2004,
69 LATIN_FIXED = 2005,
70 CJK_TEXT = 3000,
71 CJK_PRESENTATION = 3001,
72 CJK_SPREADSHEET = 3002,
73 CJK_HEADING = 3003,
74 CJK_DISPLAY = 3004,
75 CTL_TEXT = 4000,
76 CTL_PRESENTATION = 4001,
77 CTL_SPREADSHEET = 4002,
78 CTL_HEADING = 4003,
79 CTL_DISPLAY = 4004,
82 UNOTOOLS_DLLPUBLIC OUString GetNextFontToken( const OUString& rTokenStr, sal_Int32& rIndex );
83 UNOTOOLS_DLLPUBLIC OUString GetEnglishSearchFontName( const OUString& rName );
85 /** Strip any "script font suffix" from the font name
87 Related: fdo#49271 RTF files often contain weird-ass
88 Win 3.1/Win95 style fontnames which attempt to put the
89 charset encoding into the filename
90 http://www.webcenter.ru/~kazarn/eng/fonts_ttf.htm
92 UNOTOOLS_DLLPUBLIC OUString StripScriptFromName(const OUString& rName);
94 /** Determine if the font is the special Star|Open Symbol font
96 @param rFontName
97 The FontName to test for being Star|Open Symbol
99 @return true if this is Star|Open Symbol
101 // FIXME It's quite possible that code using this should instead check for RTL_TEXTENCODING_SYMBOL.
102 UNOTOOLS_DLLPUBLIC bool IsStarSymbol(const OUString &rFontName);
104 #endif // INCLUDED_UNOTOOLS_FONTDEFS_HXX
106 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */