• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ XeTeXFontInst类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中XeTeXFontInst的典型用法代码示例。如果您正苦于以下问题:C++ XeTeXFontInst类的具体用法?C++ XeTeXFontInst怎么用?C++ XeTeXFontInst使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了XeTeXFontInst类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: ot_part_full_advance

int
ot_part_full_advance(int f, const GlyphAssembly* a, int i)
{
    int rval = 0;

    if (fontarea[f] == OTGR_FONT_FLAG) {
        XeTeXFontInst*  font = (XeTeXFontInst*)getFont((XeTeXLayoutEngine)fontlayoutengine[f]);
        rval = D2Fix(font->unitsToPoints(SWAP(a->partRecords[i].fullAdvance)));
    }

    return rval;
}
开发者ID:texlive,项目名称:texlive-source,代码行数:12,代码来源:XeTeXOTMath.cpp


示例2: otpartfulladvance

int
otpartfulladvance(int f, const GlyphAssembly* a, int i)
{
	int	rval = 0;
	
	if (fontarea[f] == OTGR_FONT_FLAG) {
		XeTeXFontInst*	font = (XeTeXFontInst*)getFont((XeTeXLayoutEngine)fontlayoutengine[f]);
		rval = X2Fix(SWAPW(a->partRecords[i].fullAdvance) * Fix2X(fontsize[f]) / font->getUnitsPerEM());
	}
	
	return rval;
}
开发者ID:luigiScarso,项目名称:mflua,代码行数:12,代码来源:XeTeXOTMath.cpp


示例3: get_ot_math_constant

int
get_ot_math_constant(int f, int n)
{
    int rval = 0;

    if (fontarea[f] == OTGR_FONT_FLAG) {
        XeTeXFontInst*  font = (XeTeXFontInst*)getFont((XeTeXLayoutEngine)fontlayoutengine[f]);
        rval = getMathConstant(font, (mathConstantIndex)n);
        /* scale according to font size, except the ones that are percentages */
        if (n > scriptScriptPercentScaleDown && n < radicalDegreeBottomRaisePercent)
            rval = D2Fix(font->unitsToPoints(rval));
    }
    return rval;
}
开发者ID:texlive,项目名称:texlive-source,代码行数:14,代码来源:XeTeXOTMath.cpp


示例4: ot_min_connector_overlap

int
ot_min_connector_overlap(int f)
{
    int rval = 0;

    if (fontarea[f] == OTGR_FONT_FLAG) {
        XeTeXFontInst*  font = (XeTeXFontInst*)getFont((XeTeXLayoutEngine)fontlayoutengine[f]);

        const char* table = font->getMathTable();
        if (table == NULL)
            return rval;

        uint16_t    offset = SWAP(((const MathTableHeader*)table)->mathVariants);
        if (offset == 0)
            return rval;
        const MathVariants* variants = (const MathVariants*)(table + offset);

        rval = D2Fix(font->unitsToPoints(SWAP(variants->minConnectorOverlap)));
    }

    return rval;
}
开发者ID:texlive,项目名称:texlive-source,代码行数:22,代码来源:XeTeXOTMath.cpp


示例5: otminconnectoroverlap

int
otminconnectoroverlap(int f)
{
	int	rval = 0;
	
	if (fontarea[f] == OTGR_FONT_FLAG) {
		XeTeXFontInst*	font = (XeTeXFontInst*)getFont((XeTeXLayoutEngine)fontlayoutengine[f]);

		const char* table = (const char*)font->getFontTable(kMATHTableTag);
		if (table == NULL)
			return rval;

		le_uint16	offset = SWAPW(((const MathTableHeader*)table)->mathVariants);
		if (offset == 0)
			return rval;
		const MathVariants* variants = (const MathVariants*)(table + offset);

		rval = X2Fix(SWAPW(variants->minConnectorOverlap) * Fix2X(fontsize[f]) / font->getUnitsPerEM());
	}

	return rval;
}
开发者ID:luigiScarso,项目名称:mflua,代码行数:22,代码来源:XeTeXOTMath.cpp


示例6: getotmathvariant

int
getotmathvariant(int f, int g, int v, integer* adv, int horiz)
{
	int	rval = g;
	*adv = -1;
	
	if (fontarea[f] == OTGR_FONT_FLAG) {
		XeTeXFontInst*	font = (XeTeXFontInst*)getFont((XeTeXLayoutEngine)fontlayoutengine[f]);

		const char* table = (const char*)font->getFontTable(kMATHTableTag);
		if (table == NULL)
			return rval;

		le_uint16	offset = SWAPW(((const MathTableHeader*)table)->mathVariants);
		if (offset == 0)
			return rval;
		const MathVariants* variants = (const MathVariants*)(table + offset);

		offset = horiz ? SWAPW(variants->horizGlyphCoverage) : SWAPW(variants->vertGlyphCoverage);
		if (offset == 0)
			return rval;
		const CoverageTable* coverage = (const CoverageTable*)(((const char*)variants) + offset);

		le_int32	index = coverage->getGlyphCoverage(g);
		if (index >= 0) {
			if (horiz)
				index += SWAPW(variants->vertGlyphCount);
			const MathGlyphConstruction*	construction = (const MathGlyphConstruction*)(((const char*)variants)
															+ SWAPW(variants->vertGlyphConstruction[index]));
			if (v < SWAPW(construction->variantCount)) {
				rval = SWAPW(construction->mathGlyphVariantRecord[v].variantGlyph);
				*adv = X2Fix(SWAPW(construction->mathGlyphVariantRecord[v].advanceMeasurement)
								* Fix2X(fontsize[f]) / font->getUnitsPerEM());
			}
		}
	}
	
	return rval;
}
开发者ID:luigiScarso,项目名称:mflua,代码行数:39,代码来源:XeTeXOTMath.cpp


示例7: get_ot_math_variant

int
get_ot_math_variant(int f, int g, int v, integer* adv, int horiz)
{
    int rval = g;
    *adv = -1;

    if (fontarea[f] == OTGR_FONT_FLAG) {
        XeTeXFontInst*  font = (XeTeXFontInst*)getFont((XeTeXLayoutEngine)fontlayoutengine[f]);

        const char* table = font->getMathTable();
        if (table == NULL)
            return rval;

        uint16_t    offset = SWAP(((const MathTableHeader*)table)->mathVariants);
        if (offset == 0)
            return rval;
        const MathVariants* variants = (const MathVariants*)(table + offset);

        offset = horiz ? SWAP(variants->horizGlyphCoverage) : SWAP(variants->vertGlyphCoverage);
        if (offset == 0)
            return rval;
        const Coverage* coverage = (const Coverage*)(((const char*)variants) + offset);

        int32_t index = getCoverage(coverage, g);
        if (index >= 0) {
            if (horiz)
                index += SWAP(variants->vertGlyphCount);
            const MathGlyphConstruction*    construction = (const MathGlyphConstruction*)(((const char*)variants)
                                                            + SWAP(variants->vertGlyphConstruction[index]));
            if (v < SWAP(construction->variantCount)) {
                rval = SWAP(construction->mathGlyphVariantRecord[v].variantGlyph);
                *adv = D2Fix(font->unitsToPoints(SWAP(construction->mathGlyphVariantRecord[v].advanceMeasurement)));
            }
        }
    }

    return rval;
}
开发者ID:texlive,项目名称:texlive-source,代码行数:38,代码来源:XeTeXOTMath.cpp


示例8: get_ot_math_accent_pos

int
get_ot_math_accent_pos(int f, int g)
{
    int rval = 0x7fffffffUL;

    if (fontarea[f] == OTGR_FONT_FLAG) {
        XeTeXFontInst*  font = (XeTeXFontInst*)getFont((XeTeXLayoutEngine)fontlayoutengine[f]);

        const char* table = font->getMathTable();
        if (table == NULL)
            return rval;

        uint16_t    offset = SWAP(((const MathTableHeader*)table)->mathGlyphInfo);
        if (offset == 0)
            return rval;
        const MathGlyphInfo* glyphInfo = (const MathGlyphInfo*)(table + offset);

        offset = SWAP(glyphInfo->mathTopAccentAttachment);
        if (offset == 0)
            return rval;
        const MathTopAccentAttachment* accentAttachment = (const MathTopAccentAttachment*)(((const char*)glyphInfo) + offset);

        offset = SWAP(accentAttachment->coverage);
        if (offset == 0)
            return rval;
        const Coverage* coverage = (const Coverage*)(((const char*)accentAttachment) + offset);

        int32_t index = getCoverage(coverage, g);
        if (index >= 0 && index < SWAP(accentAttachment->topAccentAttachmentCount)) {
            rval = (int16_t)SWAP(accentAttachment->topAccentAttachment[index].value);
            rval = D2Fix(font->unitsToPoints(rval));
        }
    }

    return rval;
}
开发者ID:texlive,项目名称:texlive-source,代码行数:36,代码来源:XeTeXOTMath.cpp


示例9: get_ot_assembly_ptr

void*
get_ot_assembly_ptr(int f, int g, int horiz)
{
    void*   rval = NULL;

    if (fontarea[f] == OTGR_FONT_FLAG) {
        XeTeXFontInst*  font = (XeTeXFontInst*)getFont((XeTeXLayoutEngine)fontlayoutengine[f]);

        const char* table = font->getMathTable();
        if (table == NULL)
            return rval;

        uint16_t    offset = SWAP(((const MathTableHeader*)table)->mathVariants);
        if (offset == 0)
            return rval;
        const MathVariants* variants = (const MathVariants*)(table + offset);

        offset = horiz ? SWAP(variants->horizGlyphCoverage) : SWAP(variants->vertGlyphCoverage);
        if (offset == 0)
            return rval;
        const Coverage* coverage = (const Coverage*)(((const char*)variants) + offset);

        int32_t index = getCoverage(coverage, g);
        if (index >= 0) {
            if (horiz)
                index += SWAP(variants->vertGlyphCount);
            const MathGlyphConstruction*    construction = (const MathGlyphConstruction*)(((const char*)variants)
                                                            + SWAP(variants->vertGlyphConstruction[index]));
            offset = SWAP(construction->glyphAssembly);
            if (offset != 0)
                rval = (void*)(((const char*)construction) + offset);
        }
    }

    return rval;
}
开发者ID:texlive,项目名称:texlive-source,代码行数:36,代码来源:XeTeXOTMath.cpp


示例10: getotmathaccentpos

int
getotmathaccentpos(int f, int g)
{
	int	rval = 0x7fffffffUL;
	
	if (fontarea[f] == OTGR_FONT_FLAG) {
		XeTeXFontInst*	font = (XeTeXFontInst*)getFont((XeTeXLayoutEngine)fontlayoutengine[f]);

		const char* table = (const char*)font->getFontTable(kMATHTableTag);
		if (table == NULL)
			return rval;

		le_uint16	offset = SWAPW(((const MathTableHeader*)table)->mathGlyphInfo);
		if (offset == 0)
			return rval;
		const MathGlyphInfo* glyphInfo = (const MathGlyphInfo*)(table + offset);

		offset = SWAPW(glyphInfo->mathTopAccentAttachment);
		if (offset == 0)
			return rval;
		const MathTopAccentAttachment* accentAttachment = (const MathTopAccentAttachment*)(((const char*)glyphInfo) + offset);

		offset = SWAPW(accentAttachment->coverage);
		if (offset == 0)
			return rval;
		const CoverageTable* coverage = (const CoverageTable*)(((const char*)accentAttachment) + offset);

		le_int32	index = coverage->getGlyphCoverage(g);
		if (index >= 0 && index < SWAPW(accentAttachment->topAccentAttachmentCount)) {
			rval = (le_int16)SWAPW(accentAttachment->topAccentAttachment[index].value);
			rval = X2Fix(rval * Fix2X(fontsize[f]) / font->getUnitsPerEM());
		}
	}
	
	return rval;
}
开发者ID:luigiScarso,项目名称:mflua,代码行数:36,代码来源:XeTeXOTMath.cpp


示例11: get_ot_math_kern

int
get_ot_math_kern(int f, int g, int sf, int sg, int cmd, int shift)
{
    int rval = 0;

    if (fontarea[f] == OTGR_FONT_FLAG) {
        XeTeXFontInst* font = (XeTeXFontInst*)getFont((XeTeXLayoutEngine)fontlayoutengine[f]);
        int kern = 0, skern = 0;
        float corr_height_top = 0.0, corr_height_bot = 0.0;

        shift = Fix2D(shift);

        if (cmd == sup_cmd) { // superscript
            corr_height_top =  font->pointsToUnits(glyph_height(f, g));
            corr_height_bot = -font->pointsToUnits(glyph_depth(sf, sg) + shift);

            kern = getMathKernAt(f, g, topRight, corr_height_top);
            skern = getMathKernAt(sf, sg, bottomLeft, corr_height_top);
            rval = kern + skern;

            kern = getMathKernAt(f, g, topRight, corr_height_bot);
            skern = getMathKernAt(sf, sg, bottomLeft, corr_height_bot);
            if ((kern + skern) < rval)
                rval = kern + skern;

        } else if (cmd == sub_cmd) { // subscript
            corr_height_top =  font->pointsToUnits(glyph_height(sf, sg) - shift);
            corr_height_bot = -font->pointsToUnits(glyph_depth(f, g));

            kern = getMathKernAt(f, g, bottomRight, corr_height_top);
            skern = getMathKernAt(sf, sg, topLeft, corr_height_top);
            rval = kern + skern;

            kern = getMathKernAt(f, g, bottomRight, corr_height_bot);
            skern = getMathKernAt(sf, sg, topLeft, corr_height_bot);
            if ((kern + skern) < rval)
                rval = kern + skern;

        } else {
            assert(0); // we should not reach here
        }

        rval = D2Fix(font->unitsToPoints(rval));
    }

    return rval;
}
开发者ID:texlive,项目名称:texlive-source,代码行数:47,代码来源:XeTeXOTMath.cpp


示例12: getMathKernAt

static int
getMathKernAt(int f, int g, MathKernSide side, int height)
{
    int rval = 0;
    if (fontarea[f] == OTGR_FONT_FLAG) {
        XeTeXFontInst* font = (XeTeXFontInst*)getFont((XeTeXLayoutEngine)fontlayoutengine[f]);

        const char* table = font->getMathTable();
        if (table == NULL)
            return rval;

        uint16_t    offset = SWAP(((const MathTableHeader*)table)->mathGlyphInfo);
        if (offset == 0)
            return rval;

        const MathGlyphInfo* glyphInfo = (const MathGlyphInfo*)(table + offset);

        offset = SWAP(glyphInfo->mathKernInfo);
        if (offset == 0)
            return rval;

        const MathKernInfo* mathKernInfo = (const MathKernInfo*)(((const char*)glyphInfo) + offset);

        offset = SWAP(mathKernInfo->coverage);
        if (offset == 0)
            return rval;

        const Coverage* coverage = (const Coverage*)(((const char*)mathKernInfo) + offset);

        int32_t index = getCoverage(coverage, g);
        if (index >= 0 && index < SWAP(mathKernInfo->kernInfoCount)) {
            if (side == topRight)
                offset = SWAP(mathKernInfo->kernInfo[index].topRight);
            else if (side == bottomRight)
                offset = SWAP(mathKernInfo->kernInfo[index].bottomRight);
            else if (side == topLeft)
                offset = SWAP(mathKernInfo->kernInfo[index].topLeft);
            else if (side == bottomLeft)
                offset = SWAP(mathKernInfo->kernInfo[index].bottomLeft);
            else
                assert(0); // we should not reach here

            if (offset == 0)
                return rval;

            const MathKernTable* kernTable = (const MathKernTable*)(((const char*)mathKernInfo) + offset);

            uint16_t count = SWAP(kernTable->heightCount);

            // XXX: the following makes no sense WRT my understanding of the
            // spec! it is just how things worked for me.
            if (count == 0)
                rval = SWAP(kernTable->kern[-1].value);
            else if (height < SWAP(kernTable->height[0].value))
                rval = SWAP(kernTable->kern[1].value);
            else if (height > SWAP(kernTable->height[count].value))
                rval = SWAP(kernTable->kern[count+1].value);
            else {
                for (int i = 0; i < count; i++) {
                    if (height > SWAP(kernTable->height[i].value)) {
                        rval = SWAP(kernTable->kern[i+1].value);
                        break;
                    }
                }
            }

            //fprintf(stderr, "   kern: %f %f\n", font->unitsToPoints(height), font->unitsToPoints(rval));
        }
    }

    return rval;
}
开发者ID:texlive,项目名称:texlive-source,代码行数:72,代码来源:XeTeXOTMath.cpp



注:本文中的XeTeXFontInst类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ XercesDOMParser类代码示例发布时间:2022-05-31
下一篇:
C++ XdgDesktopFile类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap