#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);