LibreOffice Module unotools (master) 1
fontdefs.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19#ifndef INCLUDED_UNOTOOLS_FONTDEFS_HXX
20#define INCLUDED_UNOTOOLS_FONTDEFS_HXX
21
22#include <sal/config.h>
23
24#include <string_view>
25
27#include <sal/types.h>
28#include <rtl/ustring.hxx>
30#include <config_options.h>
31
32enum class SubsFontFlags
33{
34 ONLYONE = 0x01,
35 MS = 0x02
36};
37
38namespace o3tl
39{
40 template<> struct typed_flags<SubsFontFlags> : is_typed_flags<SubsFontFlags, 0x03> {};
41}
42
43UNOTOOLS_DLLPUBLIC OUString GetSubsFontName( std::u16string_view rName, SubsFontFlags nFlags );
44
45UNLESS_MERGELIBS(UNOTOOLS_DLLPUBLIC) void AddTokenFontName( OUString& rName, std::u16string_view rNewToken );
46
47
48class UNLESS_MERGELIBS(UNOTOOLS_DLLPUBLIC) ConvertChar
49{
50public:
51 const sal_Unicode* mpCvtTab;
52 const char* mpSubsFontName;
53 sal_Unicode (*mpCvtFunc)( sal_Unicode );
54 sal_Unicode RecodeChar( sal_Unicode c ) const;
55 void RecodeString( OUString& rStra, sal_Int32 nIndex, sal_Int32 nLen ) const;
56 static const ConvertChar* GetRecodeData( std::u16string_view rOrgFontName, std::u16string_view rMapFontName );
57};
58
59
61{
62 SANS_UNICODE = 1,
63 SANS = 2,
64 SERIF = 3,
65 FIXED = 4,
66 SYMBOL = 5,
67 UI_SANS = 1000,
68 UI_FIXED = 1001,
69 LATIN_TEXT = 2000,
70 LATIN_PRESENTATION = 2001,
71 LATIN_SPREADSHEET = 2002,
72 LATIN_HEADING = 2003,
73 LATIN_DISPLAY = 2004,
74 LATIN_FIXED = 2005,
75 CJK_TEXT = 3000,
76 CJK_PRESENTATION = 3001,
77 CJK_SPREADSHEET = 3002,
78 CJK_HEADING = 3003,
79 CJK_DISPLAY = 3004,
80 CTL_TEXT = 4000,
81 CTL_PRESENTATION = 4001,
82 CTL_SPREADSHEET = 4002,
83 CTL_HEADING = 4003,
84 CTL_DISPLAY = 4004,
85};
86
87UNOTOOLS_DLLPUBLIC std::u16string_view GetNextFontToken( std::u16string_view rTokenStr, sal_Int32& rIndex );
88UNOTOOLS_DLLPUBLIC OUString GetEnglishSearchFontName( std::u16string_view rName );
89
97UNOTOOLS_DLLPUBLIC OUString StripScriptFromName(const OUString& rName);
98
106// FIXME It's quite possible that code using this should instead check for RTL_TEXTENCODING_SYMBOL.
107UNOTOOLS_DLLPUBLIC bool IsOpenSymbol(std::u16string_view rFontName);
108
109#endif // INCLUDED_UNOTOOLS_FONTDEFS_HXX
110
111/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void AddTokenFontName(OUString &rName, std::u16string_view rNewToken)
Definition: fontdefs.cxx:368
UNOTOOLS_DLLPUBLIC OUString StripScriptFromName(const OUString &rName)
Strip any "script font suffix" from the font name.
Definition: fontdefs.cxx:29
UNOTOOLS_DLLPUBLIC OUString GetEnglishSearchFontName(std::u16string_view rName)
Definition: fontdefs.cxx:86
DefaultFontType
Definition: fontdefs.hxx:61
UNLESS_MERGELIBS(UNOTOOLS_DLLPUBLIC) void AddTokenFontName(OUString &rName
SubsFontFlags
Definition: fontdefs.hxx:33
std::u16string_view rNewToken
Definition: fontdefs.hxx:45
UNOTOOLS_DLLPUBLIC bool IsOpenSymbol(std::u16string_view rFontName)
Determine if the font is the special Open|Star Symbol font.
Definition: fontdefs.cxx:406
UNOTOOLS_DLLPUBLIC std::u16string_view GetNextFontToken(std::u16string_view rTokenStr, sal_Int32 &rIndex)
Definition: fontdefs.cxx:301
UNOTOOLS_DLLPUBLIC OUString GetSubsFontName(std::u16string_view rName, SubsFontFlags nFlags)
Definition: fontdefs.cxx:374
SYMBOL
sal_uInt16 sal_Unicode
#define UNOTOOLS_DLLPUBLIC