File indexing completed on 2024-05-12 04:47:03

0001 /*
0002  * Copyright: 2016 Canonical Ltd.
0003  *
0004  * This file is part of ubuntu-terminal-app
0005  *
0006  * ubuntu-terminal-app is free software: you can redistribute it and/or modify
0007  * it under the terms of the GNU General Public License as published by
0008  * the Free Software Foundation, either version 3 of the License, or
0009  * (at your option) any later version.
0010  *
0011  * ubuntu-terminal-app is distributed in the hope that it will be useful,
0012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0014  * GNU General Public License for more details.
0015  *
0016  * You should have received a copy of the GNU General Public License
0017  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
0018  *
0019  * Author: Florian Boucault <florian.boucault@canonical.com>
0020  */
0021 
0022 #include "fonts.h"
0023 
0024 Fonts::Fonts()
0025 {
0026     updateFamilies();
0027 }
0028 
0029 void Fonts::updateFamilies()
0030 {
0031     m_monospaceFamilies.clear();
0032 
0033     foreach (const QString &family, m_fontDatabase.families()) {
0034         if (m_fontDatabase.isFixedPitch(family)) {
0035             m_monospaceFamilies << family;
0036         }
0037     }
0038     Q_EMIT monospaceFamiliesChanged();
0039 }
0040 
0041 QStringList Fonts::monospaceFamilies() const
0042 {
0043     return m_monospaceFamilies;
0044 }