/src/libreoffice/include/unotools/fontcvt.hxx
Line | Count | Source |
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 | | |
20 | | #ifndef INCLUDED_UNOTOOLS_FONTCVT_HXX |
21 | | #define INCLUDED_UNOTOOLS_FONTCVT_HXX |
22 | | |
23 | | #include <sal/config.h> |
24 | | |
25 | | #include <string_view> |
26 | | |
27 | | #include <unotools/unotoolsdllapi.h> |
28 | | #include <rtl/ustring.hxx> |
29 | | |
30 | | |
31 | | enum class FontToSubsFontFlags |
32 | | { |
33 | | IMPORT = 0x01, |
34 | | EXPORT = 0x02 |
35 | | }; |
36 | | |
37 | | typedef void* FontToSubsFontConverter; |
38 | | UNOTOOLS_DLLPUBLIC FontToSubsFontConverter CreateFontToSubsFontConverter( std::u16string_view rFontName, FontToSubsFontFlags nFlags ); |
39 | | UNOTOOLS_DLLPUBLIC sal_Unicode ConvertFontToSubsFontChar( FontToSubsFontConverter hConverter, sal_Unicode c ); |
40 | | UNOTOOLS_DLLPUBLIC OUString GetFontToSubsFontName( FontToSubsFontConverter hConverter ); |
41 | | |
42 | | |
43 | | class UNOTOOLS_DLLPUBLIC StarSymbolToMSMultiFont |
44 | | { |
45 | | public: |
46 | | // Returns the name of the best windows symbol font which this char can be |
47 | | // mapped to. Sets rChar to the correct position for that font. If no |
48 | | // match found, then no name is returned, and rChar is unchanged. If you |
49 | | // want to convert a string, you don't want to use this. |
50 | | virtual OUString ConvertChar(sal_Unicode &rChar) = 0; |
51 | | |
52 | 0 | virtual ~StarSymbolToMSMultiFont() {} |
53 | | }; |
54 | | |
55 | | |
56 | | // The converter will allow somewhat dubious mappings to the windows symbols fonts, |
57 | | // that are nevertheless recognizably similar. Even in this mode there will be characters that fail. |
58 | | // The users of this might want to make a distinction between failed characters |
59 | | // which were inside and those outside the unicode private area. |
60 | | UNOTOOLS_DLLPUBLIC StarSymbolToMSMultiFont *CreateStarSymbolToMSMultiFont(); |
61 | | |
62 | | #endif // INCLUDED_UNOTOOLS_FONTCVT_HXX |
63 | | |
64 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |