Bump version to 4.1-6
[LibreOffice.git] / vcl / generic / print / glyphset.hxx
bloba062bb829b1bcd5677fed6c4819b15155c1ecc99
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 .
20 #ifndef _PSPRINT_GLYPHSET_HXX_
21 #define _PSPRINT_GLYPHSET_HXX_
23 #include "vcl/fontmanager.hxx"
25 #include "osl/file.hxx"
27 #include "rtl/string.hxx"
29 #include <list>
30 #include <boost/unordered_map.hpp>
32 class Point;
34 namespace psp {
36 class PrinterGfx;
37 class PrintFontManager;
39 class GlyphSet
41 private:
43 sal_Int32 mnFontID;
44 sal_Bool mbVertical;
45 OString maBaseName;
46 fonttype::type meBaseType;
47 rtl_TextEncoding mnBaseEncoding;
48 bool mbUseFontEncoding;
50 typedef boost::unordered_map< sal_Unicode, sal_uInt8 > char_map_t;
51 typedef std::list< char_map_t > char_list_t;
52 typedef boost::unordered_map< sal_uInt32, sal_uInt8 > glyph_map_t;
53 typedef std::list< glyph_map_t > glyph_list_t;
55 char_list_t maCharList;
56 glyph_list_t maGlyphList;
58 OString GetGlyphSetName (sal_Int32 nGlyphSetID);
59 OString GetCharSetName (sal_Int32 nGlyphSetID);
60 sal_Int32 GetGlyphSetEncoding (sal_Int32 nGlyphSetID);
61 OString GetGlyphSetEncodingName (sal_Int32 nGlyphSetID);
63 OString GetReencodedFontName (sal_Int32 nGlyphSetID);
64 void PSDefineReencodedFont (osl::File* pOutFile,
65 sal_Int32 nGlyphSetID);
67 sal_Bool GetCharID (sal_Unicode nChar,
68 sal_uChar* nOutGlyphID, sal_Int32* nOutGlyphSetID);
69 sal_Bool LookupCharID (sal_Unicode nChar,
70 sal_uChar* nOutGlyphID, sal_Int32* nOutGlyphSetID);
71 sal_Bool AddCharID (sal_Unicode nChar,
72 sal_uChar* nOutGlyphID,
73 sal_Int32* nOutGlyphSetID);
74 sal_Bool GetGlyphID (sal_uInt32 nGlyph, sal_Unicode nUnicode,
75 sal_uChar* nOutGlyphID, sal_Int32* nOutGlyphSetID);
76 sal_Bool LookupGlyphID (sal_uInt32 nGlyph,
77 sal_uChar* nOutGlyphID, sal_Int32* nOutGlyphSetID);
78 sal_Bool AddGlyphID (sal_uInt32 nGlyph, sal_Unicode nUnicode,
79 sal_uChar* nOutGlyphID,
80 sal_Int32* nOutGlyphSetID);
81 void AddNotdef (char_map_t &rCharMap);
82 void AddNotdef (glyph_map_t &rGlyphMap);
83 sal_uChar GetAnsiMapping (sal_Unicode nUnicodeChar);
84 sal_uChar GetSymbolMapping (sal_Unicode nUnicodeChar);
86 void ImplDrawText (PrinterGfx &rGfx, const Point& rPoint,
87 const sal_Unicode* pStr, sal_Int16 nLen);
88 void ImplDrawText (PrinterGfx &rGfx, const Point& rPoint,
89 const sal_Unicode* pStr, sal_Int16 nLen,
90 const sal_Int32* pDeltaArray);
92 public:
94 GlyphSet (sal_Int32 nFontID, sal_Bool bVertical);
95 ~GlyphSet ();
97 sal_Int32 GetFontID ();
98 fonttype::type GetFontType ();
99 static OString
100 GetReencodedFontName (rtl_TextEncoding nEnc,
101 const OString &rFontName);
102 static OString
103 GetGlyphSetEncodingName (rtl_TextEncoding nEnc,
104 const OString &rFontName);
105 sal_Bool IsVertical ();
107 void DrawText (PrinterGfx &rGfx, const Point& rPoint,
108 const sal_Unicode* pStr, sal_Int16 nLen,
109 const sal_Int32* pDeltaArray = NULL);
110 void DrawGlyphs (PrinterGfx& rGfx,
111 const Point& rPoint,
112 const sal_uInt32* pGlyphIds,
113 const sal_Unicode* pUnicodes,
114 sal_Int16 nLen,
115 const sal_Int32* pDeltaArray,
116 sal_Bool bUseGlyphs=sal_True);
117 sal_Bool PSUploadEncoding(osl::File* pOutFile, PrinterGfx &rGfx);
118 sal_Bool PSUploadFont (osl::File& rOutFile, PrinterGfx &rGfx, bool bAsType42, std::list< OString >& rSuppliedFonts );
122 } /* namespace psp */
124 #endif
126 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */