提交 500f913b 编写于 作者: S Stefan Weil

PangoFontInfo: Remove unused method is_monospace

Remove also some macros which are no longer needed.
Signed-off-by: NStefan Weil <sw@weilnetz.de>
上级 059e30d4
......@@ -91,7 +91,6 @@ void PangoFontInfo::Clear() {
is_bold_ = false;
is_italic_ = false;
is_smallcaps_ = false;
is_monospace_ = false;
family_name_.clear();
font_type_ = UNKNOWN;
if (desc_) {
......@@ -172,29 +171,6 @@ static void ListFontFamilies(PangoFontFamily*** families,
pango_font_map_list_families(font_map, families, n_families);
}
// Inspects whether a given font family is monospace. If the font is not
// available, it cannot make a decision and returns false by default.
static bool IsMonospaceFontFamily(const char* family_name) {
PangoFontFamily** families = 0;
int n_families = 0;
bool is_monospace = false;
ListFontFamilies(&families, &n_families);
ASSERT_HOST(n_families > 0);
bool found = false;
for (int i = 0; i < n_families; ++i) {
if (!strcasecmp(family_name, pango_font_family_get_name(families[i]))) {
is_monospace = pango_font_family_is_monospace(families[i]);
found = true;
break;
}
}
if (!found) {
tlog(1, "Could not find monospace property of family %s\n", family_name);
}
g_free(families);
return is_monospace;
}
bool PangoFontInfo::ParseFontDescription(const PangoFontDescription *desc) {
Clear();
const char* family = pango_font_description_get_family(desc);
......@@ -207,7 +183,6 @@ bool PangoFontInfo::ParseFontDescription(const PangoFontDescription *desc) {
}
family_name_ = string(family);
desc_ = pango_font_description_copy(desc);
is_monospace_ = IsMonospaceFontFamily(family);
// Set font size in points
font_size_ = pango_font_description_get_size(desc);
......
......@@ -108,7 +108,6 @@ class PangoFontInfo {
bool is_bold() const { return is_bold_; }
bool is_italic() const { return is_italic_; }
bool is_smallcaps() const { return is_smallcaps_; }
bool is_monospace() const { return is_monospace_; }
FontTypeEnum font_type() const { return font_type_; }
int resolution() const { return resolution_; }
......@@ -130,7 +129,6 @@ class PangoFontInfo {
bool is_bold_;
bool is_italic_;
bool is_smallcaps_;
bool is_monospace_;
FontTypeEnum font_type_;
// The Pango description that was used to initialize the instance.
PangoFontDescription* desc_;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册