FontStyle.cpp
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., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
20 *
21 * For further information visit http://libwpd.sourceforge.net
22 *
23 */
24
25/* "This product is not manufactured, approved, or supported by
26 * Corel Corporation or Corel Corporation Limited."
27 */
28#include "FontStyle.h"
29#include "WriterProperties.h"
30#include "DocumentElement.h"
31
32FontStyle::FontStyle(const char *psName, const char *psFontFamily) : Style(psName),
33 msFontFamily(psFontFamily),
34 msFontPitch(IMP_DEFAULT_FONT_PITCH)
35{
36}
37
38FontStyle::~FontStyle()
39{
40}
41
42void FontStyle::write(DocumentHandler &xHandler) const
43{
44 TagOpenElement styleOpen("style:font-decl");
45 styleOpen.addAttribute("style:name", getName());
46 styleOpen.addAttribute("fo:font-family", msFontFamily);
47 styleOpen.addAttribute("style:font-pitch", msFontPitch);
48 styleOpen.write(xHandler);
49 TagCloseElement styleClose("style:font-decl");
50 styleClose.write(xHandler);
51}