filters

FontStyle.cxx

00001 /* FontStyle: Stores (and writes) font-based information that is needed at 
00002  * the head of an OO document.
00003  *
00004  * Copyright (C) 2002-2003 William Lachance (william.lachance@sympatico.ca)
00005  * 
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2 of the License, or (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Library General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Library General Public
00017  * License along with this library; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019  * Boston, MA 02110-1301, USA.
00020  *
00021  * For further information visit http://libwpd.sourceforge.net
00022  *
00023  */
00024 
00025 /* "This product is not manufactured, approved, or supported by 
00026  * Corel Corporation or Corel Corporation Limited."
00027  */
00028 #include "FontStyle.hxx"
00029 #include "WriterProperties.hxx"
00030 #include "DocumentElement.hxx"
00031 
00032 FontStyle::FontStyle(const char *psName, const char *psFontFamily) : Style(psName),
00033     msFontFamily(psFontFamily),
00034     msFontPitch(IMP_DEFAULT_FONT_PITCH)
00035 {
00036 }
00037 
00038 FontStyle::~FontStyle() 
00039 {
00040 }
00041 
00042 void FontStyle::write(DocumentHandler &xHandler) const
00043 {        
00044     TagOpenElement styleOpen("style:font-decl");
00045     styleOpen.addAttribute("style:name", getName());
00046     styleOpen.addAttribute("fo:font-family", msFontFamily);
00047     styleOpen.addAttribute("style:font-pitch", msFontPitch);
00048     styleOpen.write(xHandler);
00049     TagCloseElement styleClose("style:font-decl");
00050     styleClose.write(xHandler);
00051 }
KDE Home | KDE Accessibility Home | Description of Access Keys