本文整理汇总了C++中MapLine::texname方法的典型用法代码示例。如果您正苦于以下问题:C++ MapLine::texname方法的具体用法?C++ MapLine::texname怎么用?C++ MapLine::texname使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MapLine
的用法示例。
在下文中一共展示了MapLine::texname方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: remove
/** Removes the map entry 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 entry has been removed */
bool FontMap::remove (const MapLine &mapline) {
bool removed = false;
if (!mapline.texname().empty()) {
vector<Subfont*> subfonts;
if (mapline.sfd())
mapline.sfd()->subfonts(subfonts);
else
subfonts.push_back(nullptr);
for (const Subfont *subfont : subfonts) {
string fontname = mapline.texname()+(subfont ? subfont->id() : "");
auto it = _entries.find(fontname);
if (it != _entries.end() && !it->second->locked) {
_entries.erase(it);
removed = true;
}
}
}
return removed;
}
示例2: 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;
}
示例3: 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;
}