本文整理汇总了C++中MapLine::fontfname方法的典型用法代码示例。如果您正苦于以下问题:C++ MapLine::fontfname方法的具体用法?C++ MapLine::fontfname怎么用?C++ MapLine::fontfname使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MapLine
的用法示例。
在下文中一共展示了MapLine::fontfname方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: replace
/** Replaces the map data of the given font.
* If the font is locked (because it's already in use) nothing happens.
* @param[in] mapline parsed font data
* @return true if data has been replaced */
bool FontMap::replace (const MapLine &mapline) {
if (mapline.texname().empty())
return false;
if (mapline.fontfname().empty() && mapline.encname().empty())
return remove(mapline);
vector<Subfont*> subfonts;
if (mapline.sfd())
mapline.sfd()->subfonts(subfonts);
else
subfonts.push_back(nullptr);
for (Subfont *subfont : subfonts) {
string fontname = mapline.texname()+(subfont ? subfont->id() : "");
auto it = _entries.find(fontname);
if (it == _entries.end())
_entries.emplace(fontname, util::make_unique<Entry>(mapline, subfont));
else if (!it->second->locked)
*it->second = Entry(mapline, subfont);
}
return true;
}
示例2: append
/** Appends given map line data to the font map if there is no entry for the corresponding
* font in the map yet.
* @param[in] mapline parsed font data
* @return true if data has been appended */
bool FontMap::append (const MapLine &mapline) {
bool appended = false;
if (!mapline.texname().empty()) {
if (!mapline.fontfname().empty() || !mapline.encname().empty()) {
vector<Subfont*> subfonts;
if (mapline.sfd())
mapline.sfd()->subfonts(subfonts);
else
subfonts.push_back(nullptr);
for (Subfont *subfont : subfonts) {
string fontname = mapline.texname()+(subfont ? subfont->id() : "");
auto it = _entries.find(fontname);
if (it == _entries.end()) {
_entries.emplace(fontname, util::make_unique<Entry>(mapline, subfont));
appended = true;
}
}
}
}
return appended;
}
示例3: fontname
FontMap::Entry::Entry (const MapLine &mapline, Subfont *sf)
: fontname(mapline.fontfname()), encname(mapline.encname()), subfont(sf), fontindex(mapline.fontindex()),
locked(false), style(mapline.bold(), mapline.extend(), mapline.slant())
{
}