1 /* FontStyle: Stores (and writes) font-based information that is needed at
2  * the head of an OO document.
3  *
4  * Copyright (C) 2002-2003 William Lachance (william.lachance@sympatico.ca)
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19  *
20  * For further information visit http://libwpd.sourceforge.net
21  *
22  */
23 
24 /* "This product is not manufactured, approved, or supported by
25  * Corel Corporation or Corel Corporation Limited."
26  */
27 #include "FontStyle.hxx"
28 #include "WriterProperties.hxx"
29 #include "DocumentElement.hxx"
30 
FontStyle(const char * psName,const char * psFontFamily)31 FontStyle::FontStyle(const char *psName, const char *psFontFamily) : Style(psName),
32 	msFontFamily(psFontFamily),
33 	msFontPitch(IMP_DEFAULT_FONT_PITCH)
34 {
35 }
36 
~FontStyle()37 FontStyle::~FontStyle()
38 {
39 }
40 
write(DocumentHandler * pHandler) const41 void FontStyle::write(DocumentHandler *pHandler) const
42 {
43 	TagOpenElement styleOpen("style:font-decl");
44 	styleOpen.addAttribute("style:name", getName());
45 	styleOpen.addAttribute("fo:font-family", msFontFamily);
46 	styleOpen.addAttribute("style:font-pitch", msFontPitch);
47 	styleOpen.write(pHandler);
48 	TagCloseElement styleClose("style:font-decl");
49 	styleClose.write(pHandler);
50 }
51