Update ooo320-m1
[ooovba.git] / vcl / unx / source / printergfx / glyphset.hxx
blob0ab05964ce28033eb2eedb58c68ee002fa12820e
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: glyphset.hxx,v $
10 * $Revision: 1.10 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _PSPRINT_GLYPHSET_HXX_
32 #define _PSPRINT_GLYPHSET_HXX_
34 #include "vcl/fontmanager.hxx"
36 #include "osl/file.hxx"
38 #include "rtl/string.hxx"
40 #include "tools/gen.hxx"
42 #include <list>
43 #include <hash_map>
45 namespace psp {
47 class PrinterGfx;
48 class PrintFontManager;
50 class GlyphSet
52 private:
54 sal_Int32 mnFontID;
55 sal_Bool mbVertical;
56 rtl::OString maBaseName;
57 fonttype::type meBaseType;
58 rtl_TextEncoding mnBaseEncoding;
59 bool mbUseFontEncoding;
61 typedef std::hash_map< sal_Unicode, sal_uInt8 > char_map_t;
62 typedef std::list< char_map_t > char_list_t;
63 typedef std::hash_map< sal_uInt32, sal_uInt8 > glyph_map_t;
64 typedef std::list< glyph_map_t > glyph_list_t;
66 char_list_t maCharList;
67 glyph_list_t maGlyphList;
69 rtl::OString GetGlyphSetName (sal_Int32 nGlyphSetID);
70 rtl::OString GetCharSetName (sal_Int32 nGlyphSetID);
71 sal_Int32 GetGlyphSetEncoding (sal_Int32 nGlyphSetID);
72 rtl::OString GetGlyphSetEncodingName (sal_Int32 nGlyphSetID);
74 rtl::OString GetReencodedFontName (sal_Int32 nGlyphSetID);
75 void PSDefineReencodedFont (osl::File* pOutFile,
76 sal_Int32 nGlyphSetID);
78 sal_Bool GetCharID (sal_Unicode nChar,
79 sal_uChar* nOutGlyphID, sal_Int32* nOutGlyphSetID);
80 sal_Bool LookupCharID (sal_Unicode nChar,
81 sal_uChar* nOutGlyphID, sal_Int32* nOutGlyphSetID);
82 sal_Bool AddCharID (sal_Unicode nChar,
83 sal_uChar* nOutGlyphID,
84 sal_Int32* nOutGlyphSetID);
85 sal_Bool GetGlyphID (sal_uInt32 nGlyph, sal_Unicode nUnicode,
86 sal_uChar* nOutGlyphID, sal_Int32* nOutGlyphSetID);
87 sal_Bool LookupGlyphID (sal_uInt32 nGlyph,
88 sal_uChar* nOutGlyphID, sal_Int32* nOutGlyphSetID);
89 sal_Bool AddGlyphID (sal_uInt32 nGlyph, sal_Unicode nUnicode,
90 sal_uChar* nOutGlyphID,
91 sal_Int32* nOutGlyphSetID);
92 void AddNotdef (char_map_t &rCharMap);
93 void AddNotdef (glyph_map_t &rGlyphMap);
94 sal_uChar GetAnsiMapping (sal_Unicode nUnicodeChar);
95 sal_uChar GetSymbolMapping (sal_Unicode nUnicodeChar);
97 void ImplDrawText (PrinterGfx &rGfx, const Point& rPoint,
98 const sal_Unicode* pStr, sal_Int16 nLen);
99 void ImplDrawText (PrinterGfx &rGfx, const Point& rPoint,
100 const sal_Unicode* pStr, sal_Int16 nLen,
101 const sal_Int32* pDeltaArray);
103 public:
105 GlyphSet ();
106 GlyphSet (sal_Int32 nFontID, sal_Bool bVertical);
107 ~GlyphSet ();
109 sal_Int32 GetFontID ();
110 fonttype::type GetFontType ();
111 static rtl::OString
112 GetReencodedFontName (rtl_TextEncoding nEnc,
113 const rtl::OString &rFontName);
114 static rtl::OString
115 GetGlyphSetEncodingName (rtl_TextEncoding nEnc,
116 const rtl::OString &rFontName);
117 sal_Bool IsVertical ();
119 sal_Bool SetFont (sal_Int32 nFontID, sal_Bool bVertical);
121 void DrawText (PrinterGfx &rGfx, const Point& rPoint,
122 const sal_Unicode* pStr, sal_Int16 nLen,
123 const sal_Int32* pDeltaArray = NULL);
124 void DrawGlyphs (PrinterGfx& rGfx,
125 const Point& rPoint,
126 const sal_uInt32* pGlyphIds,
127 const sal_Unicode* pUnicodes,
128 sal_Int16 nLen,
129 const sal_Int32* pDeltaArray );
130 sal_Bool PSUploadEncoding(osl::File* pOutFile, PrinterGfx &rGfx);
131 sal_Bool PSUploadFont (osl::File& rOutFile, PrinterGfx &rGfx, bool bAsType42, std::list< rtl::OString >& rSuppliedFonts );
135 } /* namespace psp */
137 #endif