⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 notefontmap.cpp

📁 LINUX下的混音软件
💻 CPP
📖 第 1 页 / 共 3 页
字号:
                std::cerr << "Warning: Unable to open pixmap file "                << pixmapFileMixedName << " or " << pixmapFileLowerName                << std::endl;            } else {                std::cerr << "Warning: Unable to open pixmap file "                << pixmapFileMixedName << std::endl;            }            return false;        } else {            src = qstrtostr(pixmapFileLowerName);        }    } else {        src = qstrtostr(pixmapFileMixedName);    }    return true;}boolNoteFontMap::hasInversion(int, CharName charName) const{    SymbolDataMap::const_iterator i = m_data.find(charName);    if (i == m_data.end())        return false;    return i->second.hasInversion();}boolNoteFontMap::getSrc(int size, CharName charName, std::string &src) const{    SymbolDataMap::const_iterator i = m_data.find(charName);    if (i == m_data.end())        return false;    src = i->second.getSrc();    if (src == "")        return false;    return checkFile(size, src);}boolNoteFontMap::getInversionSrc(int size, CharName charName, std::string &src) const{    SymbolDataMap::const_iterator i = m_data.find(charName);    if (i == m_data.end())        return false;    if (!i->second.hasInversion())        return false;    src = i->second.getInversionSrc();    if (src == "")        return false;    return checkFile(size, src);}SystemFont *NoteFontMap::getSystemFont(int size, CharName charName, int &charBase)const{    SymbolDataMap::const_iterator i = m_data.find(charName);    if (i == m_data.end())        return false;    SizeDataMap::const_iterator si = m_sizes.find(size);    if (si == m_sizes.end())        return false;    int fontId = i->second.getFontId();    unsigned int fontHeight = 0;    if (!si->second.getFontHeight(fontId, fontHeight)) {        if (fontId == 0 || !si->second.getFontHeight(0, fontHeight)) {            fontHeight = size;        }    }    SystemFontNameMap::const_iterator fni = m_systemFontNames.find(fontId);    if (fontId < 0 || fni == m_systemFontNames.end())        return false;    QString fontName = fni->second;    CharBaseMap::const_iterator bi = m_bases.find(fontId);    if (bi == m_bases.end())        charBase = 0;    else        charBase = bi->second;    SystemFontSpec spec(fontName, fontHeight);    SystemFontMap::const_iterator fi = m_systemFontCache.find(spec);    if (fi != m_systemFontCache.end()) {        return fi->second;    }    SystemFont *font = SystemFont::loadSystemFont(spec);    if (!font)        return 0;    m_systemFontCache[spec] = font;    NOTATION_DEBUG << "NoteFontMap::getFont: loaded font " << fontName    << " at pixel size " << fontHeight << endl;    return font;}SystemFont::StrategyNoteFontMap::getStrategy(int, CharName charName) const{    SymbolDataMap::const_iterator i = m_data.find(charName);    if (i == m_data.end())        return SystemFont::PreferGlyphs;    int fontId = i->second.getFontId();    SystemFontStrategyMap::const_iterator si =        m_systemFontStrategies.find(fontId);    if (si != m_systemFontStrategies.end()) {        return si->second;    }    return SystemFont::PreferGlyphs;}boolNoteFontMap::getCode(int, CharName charName, int &code) const{    SymbolDataMap::const_iterator i = m_data.find(charName);    if (i == m_data.end())        return false;    code = i->second.getCode();    return (code >= 0);}boolNoteFontMap::getInversionCode(int, CharName charName, int &code) const{    SymbolDataMap::const_iterator i = m_data.find(charName);    if (i == m_data.end())        return false;    code = i->second.getInversionCode();    return (code >= 0);}boolNoteFontMap::getGlyph(int, CharName charName, int &glyph) const{    SymbolDataMap::const_iterator i = m_data.find(charName);    if (i == m_data.end())        return false;    glyph = i->second.getGlyph();    return (glyph >= 0);}boolNoteFontMap::getInversionGlyph(int, CharName charName, int &glyph) const{    SymbolDataMap::const_iterator i = m_data.find(charName);    if (i == m_data.end())        return false;    glyph = i->second.getInversionGlyph();    return (glyph >= 0);}boolNoteFontMap::getStaffLineThickness(int size, unsigned int &thickness) const{    SizeDataMap::const_iterator i = m_sizes.find(size);    if (i == m_sizes.end())        return false;    return i->second.getStaffLineThickness(thickness);}boolNoteFontMap::getLegerLineThickness(int size, unsigned int &thickness) const{    SizeDataMap::const_iterator i = m_sizes.find(size);    if (i == m_sizes.end())        return false;    return i->second.getLegerLineThickness(thickness);}boolNoteFontMap::getStemThickness(int size, unsigned int &thickness) const{    SizeDataMap::const_iterator i = m_sizes.find(size);    if (i == m_sizes.end())        return false;    return i->second.getStemThickness(thickness);}boolNoteFontMap::getBeamThickness(int size, unsigned int &thickness) const{    SizeDataMap::const_iterator i = m_sizes.find(size);    if (i == m_sizes.end())        return false;    return i->second.getBeamThickness(thickness);}boolNoteFontMap::getStemLength(int size, unsigned int &length) const{    SizeDataMap::const_iterator i = m_sizes.find(size);    if (i == m_sizes.end())        return false;    return i->second.getStemLength(length);}boolNoteFontMap::getFlagSpacing(int size, unsigned int &spacing) const{    SizeDataMap::const_iterator i = m_sizes.find(size);    if (i == m_sizes.end())        return false;    return i->second.getFlagSpacing(spacing);}boolNoteFontMap::getHotspot(int size, CharName charName, int width, int height,                        int &x, int &y) const{    HotspotDataMap::const_iterator i = m_hotspots.find(charName);    if (i == m_hotspots.end())        return false;    return i->second.getHotspot(size, width, height, x, y);}boolNoteFontMap::HotspotData::getHotspot(int size, int width, int height,                                     int &x, int &y) const{    DataMap::const_iterator i = m_data.find(size);    if (i == m_data.end()) {        i = m_data.find(0); // fixed-pixel hotspot        x = 0;        if (m_scaled.first >= 0) {            x = toSize(width, m_scaled.first, false);        } else {            if (i != m_data.end()) {                x = i->second.first;            }        }        if (m_scaled.second >= 0) {            y = toSize(height, m_scaled.second, false);            return true;        } else {            if (i != m_data.end()) {                y = i->second.second;                return true;            }            return false;        }    }    x = i->second.first;    y = i->second.second;    return true;}QStringListNoteFontMap::getSystemFontNames() const{    QStringList names;    for (SystemFontNameMap::const_iterator i = m_systemFontNames.begin();            i != m_systemFontNames.end(); ++i) {        names.append(i->second);    }    return names;}voidNoteFontMap::dump() const{    // debug code    std::cout << "Font data:\nName: " << getName() << "\nOrigin: " << getOrigin()    << "\nCopyright: " << getCopyright() << "\nMapped by: "    << getMappedBy() << "\nType: " << getType()    << "\nSmooth: " << isSmooth() << std::endl;    std::set<int> sizes = getSizes();    std::set<CharName> names = getCharNames();    for (std::set<int>::iterator sizei = sizes.begin(); sizei != sizes.end();            ++sizei) {        std::cout << "\nSize: " << *sizei << "\n" << std::endl;        unsigned int t = 0;        if (getStaffLineThickness(*sizei, t)) {            std::cout << "Staff line thickness: " << t << std::endl;        }        if (getLegerLineThickness(*sizei, t)) {            std::cout << "Leger line thickness: " << t << std::endl;        }        if (getStemThickness(*sizei, t)) {            std::cout << "Stem thickness: " << t << std::endl;        }        if (getBeamThickness(*sizei, t)) {            std::cout << "Beam thickness: " << t << std::endl;        }        if (getStemLength(*sizei, t)) {            std::cout << "Stem length: " << t << std::endl;        }        if (getFlagSpacing(*sizei, t)) {            std::cout << "Flag spacing: " << t << std::endl;        }        for (std::set<CharName>::iterator namei = names.begin();                namei != names.end(); ++namei) {            std::cout << "\nCharacter: " << namei->c_str() << std::endl;            std::string s;            int x, y, c;            if (getSrc(*sizei, *namei, s)) {                std::cout << "Src: " << s << std::endl;            }            if (getInversionSrc(*sizei, *namei, s)) {                std::cout << "Inversion src: " << s << std::endl;            }            if (getCode(*sizei, *namei, c)) {                std::cout << "Code: " << c << std::endl;            }            if (getInversionCode(*sizei, *namei, c)) {                std::cout << "Inversion code: " << c << std::endl;            }            if (getGlyph(*sizei, *namei, c)) {                std::cout << "Glyph: " << c << std::endl;            }            if (getInversionGlyph(*sizei, *namei, c)) {                std::cout << "Inversion glyph: " << c << std::endl;            }            if (getHotspot(*sizei, *namei, 1, 1, x, y)) {                std::cout << "Hot spot: (" << x << "," << y << ")" << std::endl;            }        }    }}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -