1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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
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
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
65 LATIN_PRESENTATION
= 2001,
66 LATIN_SPREADSHEET
= 2002,
71 CJK_PRESENTATION
= 3001,
72 CJK_SPREADSHEET
= 3002,
76 CTL_PRESENTATION
= 4001,
77 CTL_SPREADSHEET
= 4002,
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
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: */