nss: upgrade to release 3.73
[LibreOffice.git] / include / unotools / fontdefs.hxx
blob887041f6f15b2be9d0990a16b1e4932a089de26f
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>
26 #include <config_options.h>
28 enum class SubsFontFlags
30 ONLYONE = 0x01,
31 MS = 0x02
34 namespace o3tl
36 template<> struct typed_flags<SubsFontFlags> : is_typed_flags<SubsFontFlags, 0x03> {};
39 UNOTOOLS_DLLPUBLIC OUString GetSubsFontName( const OUString& rName, SubsFontFlags nFlags );
41 UNOTOOLS_DLLPUBLIC void AddTokenFontName( OUString& rName, const OUString& rNewToken );
44 class UNLESS_MERGELIBS(UNOTOOLS_DLLPUBLIC) ConvertChar
46 public:
47 const sal_Unicode* mpCvtTab;
48 const char* mpSubsFontName;
49 sal_Unicode (*mpCvtFunc)( sal_Unicode );
50 sal_Unicode RecodeChar( sal_Unicode c ) const;
51 void RecodeString( OUString& rStra, sal_Int32 nIndex, sal_Int32 nLen ) const;
52 static const ConvertChar* GetRecodeData( const OUString& rOrgFontName, const OUString& rMapFontName );
56 enum class DefaultFontType
58 SANS_UNICODE = 1,
59 SANS = 2,
60 SERIF = 3,
61 FIXED = 4,
62 SYMBOL = 5,
63 UI_SANS = 1000,
64 UI_FIXED = 1001,
65 LATIN_TEXT = 2000,
66 LATIN_PRESENTATION = 2001,
67 LATIN_SPREADSHEET = 2002,
68 LATIN_HEADING = 2003,
69 LATIN_DISPLAY = 2004,
70 LATIN_FIXED = 2005,
71 CJK_TEXT = 3000,
72 CJK_PRESENTATION = 3001,
73 CJK_SPREADSHEET = 3002,
74 CJK_HEADING = 3003,
75 CJK_DISPLAY = 3004,
76 CTL_TEXT = 4000,
77 CTL_PRESENTATION = 4001,
78 CTL_SPREADSHEET = 4002,
79 CTL_HEADING = 4003,
80 CTL_DISPLAY = 4004,
83 UNOTOOLS_DLLPUBLIC OUString GetNextFontToken( const OUString& rTokenStr, sal_Int32& rIndex );
84 UNOTOOLS_DLLPUBLIC OUString GetEnglishSearchFontName( const OUString& rName );
86 /** Strip any "script font suffix" from the font name
88 Related: fdo#49271 RTF files often contain weird-ass
89 Win 3.1/Win95 style fontnames which attempt to put the
90 charset encoding into the filename
91 http://www.webcenter.ru/~kazarn/eng/fonts_ttf.htm
93 UNOTOOLS_DLLPUBLIC OUString StripScriptFromName(const OUString& rName);
95 /** Determine if the font is the special Star|Open Symbol font
97 @param rFontName
98 The FontName to test for being Star|Open Symbol
100 @return true if this is Star|Open Symbol
102 // FIXME It's quite possible that code using this should instead check for RTL_TEXTENCODING_SYMBOL.
103 UNOTOOLS_DLLPUBLIC bool IsStarSymbol(const OUString &rFontName);
105 #endif // INCLUDED_UNOTOOLS_FONTDEFS_HXX
107 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */