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>
26 #include <config_options.h>
28 enum class SubsFontFlags
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
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
66 LATIN_PRESENTATION
= 2001,
67 LATIN_SPREADSHEET
= 2002,
72 CJK_PRESENTATION
= 3001,
73 CJK_SPREADSHEET
= 3002,
77 CTL_PRESENTATION
= 4001,
78 CTL_SPREADSHEET
= 4002,
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
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: */