1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: glyphset.hxx,v $
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 <psprint/fontmanager.hxx>
35 #include <osl/file.hxx>
36 #include <rtl/string.hxx>
37 #include <tools/gen.hxx>
38 #ifndef __SGI_STL_LIST
46 class PrintFontManager
;
54 rtl::OString maBaseName
;
55 fonttype::type meBaseType
;
56 rtl_TextEncoding mnBaseEncoding
;
57 bool mbUseFontEncoding
;
59 typedef std::hash_map
< sal_Unicode
, sal_uInt8
> char_map_t
;
60 typedef std::list
< char_map_t
> char_list_t
;
61 typedef std::hash_map
< sal_uInt32
, sal_uInt8
> glyph_map_t
;
62 typedef std::list
< glyph_map_t
> glyph_list_t
;
64 char_list_t maCharList
;
65 glyph_list_t maGlyphList
;
67 rtl::OString
GetGlyphSetName (sal_Int32 nGlyphSetID
);
68 rtl::OString
GetCharSetName (sal_Int32 nGlyphSetID
);
69 sal_Int32
GetGlyphSetEncoding (sal_Int32 nGlyphSetID
);
70 rtl::OString
GetGlyphSetEncodingName (sal_Int32 nGlyphSetID
);
72 rtl::OString
GetReencodedFontName (sal_Int32 nGlyphSetID
);
73 void PSDefineReencodedFont (osl::File
* pOutFile
,
74 sal_Int32 nGlyphSetID
);
76 sal_Bool
GetCharID (sal_Unicode nChar
,
77 sal_uChar
* nOutGlyphID
, sal_Int32
* nOutGlyphSetID
);
78 sal_Bool
LookupCharID (sal_Unicode nChar
,
79 sal_uChar
* nOutGlyphID
, sal_Int32
* nOutGlyphSetID
);
80 sal_Bool
AddCharID (sal_Unicode nChar
,
81 sal_uChar
* nOutGlyphID
,
82 sal_Int32
* nOutGlyphSetID
);
83 sal_Bool
GetGlyphID (sal_uInt32 nGlyph
, sal_Unicode nUnicode
,
84 sal_uChar
* nOutGlyphID
, sal_Int32
* nOutGlyphSetID
);
85 sal_Bool
LookupGlyphID (sal_uInt32 nGlyph
,
86 sal_uChar
* nOutGlyphID
, sal_Int32
* nOutGlyphSetID
);
87 sal_Bool
AddGlyphID (sal_uInt32 nGlyph
, sal_Unicode nUnicode
,
88 sal_uChar
* nOutGlyphID
,
89 sal_Int32
* nOutGlyphSetID
);
90 void AddNotdef (char_map_t
&rCharMap
);
91 void AddNotdef (glyph_map_t
&rGlyphMap
);
92 sal_uChar
GetAnsiMapping (sal_Unicode nUnicodeChar
);
93 sal_uChar
GetSymbolMapping (sal_Unicode nUnicodeChar
);
95 void ImplDrawText (PrinterGfx
&rGfx
, const Point
& rPoint
,
96 const sal_Unicode
* pStr
, sal_Int16 nLen
);
97 void ImplDrawText (PrinterGfx
&rGfx
, const Point
& rPoint
,
98 const sal_Unicode
* pStr
, sal_Int16 nLen
,
99 const sal_Int32
* pDeltaArray
);
104 GlyphSet (sal_Int32 nFontID
, sal_Bool bVertical
);
107 sal_Int32
GetFontID ();
108 fonttype::type
GetFontType ();
110 GetReencodedFontName (rtl_TextEncoding nEnc
,
111 const rtl::OString
&rFontName
);
113 GetGlyphSetEncodingName (rtl_TextEncoding nEnc
,
114 const rtl::OString
&rFontName
);
115 sal_Bool
IsVertical ();
117 sal_Bool
SetFont (sal_Int32 nFontID
, sal_Bool bVertical
);
119 void DrawText (PrinterGfx
&rGfx
, const Point
& rPoint
,
120 const sal_Unicode
* pStr
, sal_Int16 nLen
,
121 const sal_Int32
* pDeltaArray
= NULL
);
122 void DrawGlyphs (PrinterGfx
& rGfx
,
124 const sal_uInt32
* pGlyphIds
,
125 const sal_Unicode
* pUnicodes
,
127 const sal_Int32
* pDeltaArray
);
128 sal_Bool
PSUploadEncoding(osl::File
* pOutFile
, PrinterGfx
&rGfx
);
129 sal_Bool
PSUploadFont (osl::File
& rOutFile
, PrinterGfx
&rGfx
, bool bAsType42
, std::list
< rtl::OString
>& rSuppliedFonts
);
133 } /* namespace psp */