PDF-glyph-cache.h

本文档介绍了MuPDF库中的若干关于字体缓存和渲染功能,包括清除缓存、渲染带抗锯齿的字形、特殊情况下处理Type3字体、缓存显示列表和统计信息。这些功能对于PDF解析和渲染至关重要,但部分可能面临API变动风险。
摘要由CSDN通过智能技术生成

#ifndef MUPDF_FITZ_GLYPH_CACHE_H
#define MUPDF_FITZ_GLYPH_CACHE_H

#include “mupdf/fitz/context.h”
#include “mupdf/fitz/geometry.h”
#include “mupdf/fitz/font.h”
#include “mupdf/fitz/pixmap.h”

/**
Purge all the glyphs from the cache.
从缓存中清除所有字形。
*/
void fz_purge_glyph_cache(fz_context *ctx);

/**
Create a pixmap containing a rendered glyph.

Lookup gid from font, clip it with scissor, and rendering it
with aa bits of antialiasing into a new pixmap.

The caller takes ownership of the pixmap and so must free it.

Note: This function is no longer used for normal rendering
operations, and is kept around just because we use it in the
app. It should be considered "at risk" of removal from the API.
创建一个包含渲染字形的像素图。

从字体中查找gid,用剪刀剪下来,渲染出来
将一些抗锯齿处理到新的像素图中。

调用者拥有像素图的所有权,因此必须释放它。

注意:此功能不再用于正常渲染
操作,并保留下来只是因为我们在
应用程序。 应将其视为从 API 中删除的“风险”。

*/
fz_pixmap *fz_render_glyph_pixmap(fz_context *ctx, fz_font *font, int gid, fz_matrix *ctm, const fz_irect *scissor, int aa);

/**
Nasty PDF interpreter specific hernia, required to allow the
interpreter to replay glyphs from a type3 font directly into
the target device.

This is only used in exceptional circumstances (such as type3
glyphs that inherit current graphics state, or nested type3
glyphs).
讨厌的 PDF 解释器特定疝气,需要允许
解释器将字形从 type3 字体直接重播到
目标设备。

这仅在特殊情况下使用(例如 type3
继承当前图形状态或嵌套 type3 的字形
字形)。

*/
void fz_render_t3_glyph_direct(fz_context *ctx, fz_device *dev, fz_font *font, int gid, fz_matrix trm, void *gstate, fz_default_colorspaces *def_cs);

/**
Force a type3 font to cache the displaylist for a given glyph
id.

This caching can involve reading the underlying file, so must
happen ahead of time, so we aren't suddenly forced to read the
file while playing a displaylist back.
强制使用 type3 字体来缓存给定字形的显示列表ID。
这种缓存可能涉及读取底层文件,因此必须
提前发生,所以我们不会突然被迫阅读
文件同时播放显示列表。

*/
void fz_prepare_t3_glyph(fz_context *ctx, fz_font *font, int gid);

/**
Dump debug statistics for the glyph cache.
转储字形缓存的调试统计信息。
*/
void fz_dump_glyph_cache_stats(fz_context *ctx, fz_output *out);

/**
Perform subpixel quantisation and adjustment on a glyph matrix.

ctm: On entry, the desired 'ideal' transformation for a glyph.
On exit, adjusted to a (very similar) transformation quantised
for subpixel caching.

subpix_ctm: Initialised by the routine to the transform that
should be used to render the glyph.

qe, qf: which subpixel position we quantised to.

Returns: the size of the glyph.

Note: This is currently only exposed for use in our app. It
should be considered "at risk" of removal from the API.

对字形矩阵执行子像素量化和调整。

ctm:在输入时,字形所需的“理想”转换。
退出时,调整为(非常相似的)转换量化
用于子像素缓存。

subpix_ctm:由例程初始化为转换
应该用于渲染字形。

qe,qf:我们量化到哪个子像素位置。

返回: 字形的大小。

注意:这目前仅公开用于我们的应用程序。 它

应被视为“有风险”从 API 中删除。
*/
float fz_subpixel_adjust(fz_context *ctx, fz_matrix *ctm, fz_matrix *subpix_ctm, unsigned char *qe, unsigned char *qf);

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值