2 * This file is part of the internal font implementation. It should not be included by anyone other than
3 * FontMac.cpp, FontWin.cpp and Font.cpp.
5 * Copyright (C) 2006 Apple Computer, Inc.
6 * Copyright (C) 2006 George Staikos <staikos@kde.org>
7 * Copyright (C) 2006 Dirk Mueller <mueller@kde.org>
8 * Copyright (C) 2006 Zack Rusin <zack@kde.org>
9 * Copyright (C) 2006 Simon Hausmann <hausmann@kde.org>
10 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
12 * All rights reserved.
14 * This library is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU Library General Public
16 * License as published by the Free Software Foundation; either
17 * version 2 of the License, or (at your option) any later version.
19 * This library is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * Library General Public License for more details.
24 * You should have received a copy of the GNU Library General Public License
25 * along with this library; see the file COPYING.LIB. If not, write to
26 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
27 * Boston, MA 02111-1307, USA.
32 #include "FontPlatformData.h"
34 #include "DeprecatedString.h"
35 #include "FontDescription.h"
42 FontPlatformData::FontPlatformData()
46 FontPlatformData::FontPlatformData(Deleted)
50 FontPlatformData::FontPlatformData(const FontDescription& fontDescription, const AtomicString& familyName)
52 QFont font("Times New Roman", 12);
53 font.setFamily(familyName.domString());
54 font.setPixelSize(fontDescription.computedSize());
55 font.setItalic(fontDescription.italic());
56 font.setWeight(fontDescription.weight());
60 FontPlatformData::FontPlatformData(const FontPlatformData& other)
61 : m_font(other.m_font)
65 FontPlatformData& FontPlatformData::operator=(const FontPlatformData& other)
67 m_font = other.m_font;
71 FontPlatformData::~FontPlatformData()
75 bool FontPlatformData::isFixedPitch()
77 return QFontInfo(m_font).fixedPitch();
80 void FontPlatformData::setFont(const QFont& other)
85 QFont FontPlatformData::font() const
90 unsigned FontPlatformData::hash() const
92 return qHash(&m_font);
95 bool FontPlatformData::operator==(const FontPlatformData& other) const
97 return (other.m_font == m_font);