FreeType Glyph Conventions 翻译(1) ——Basic Typographic Concepts 基础印刷概念

原文地址 https://freetype.org/freetype2/docs/glyphs/glyphs-1.html

字体文件,格式以及信息 (Font files, format and information)

A font is a collection of various character images that can be used to display or print text.
字体是多个字符图形的集合,能被用于展示或者打印文本。

The images in a single font share some common properties, including look, style, serifs, etc
一个字体中的字符共享一些属性,包括外形,样式,衬线等等。

Typographically speaking, one has to distinguish between a font family and its multiple font faces, which usually differ in style though coming from the same template.
从印刷的角度说,我们需要区分字体族(font family)和它的多个字体(font faces),这些字体经常在样式上有所区别。

For example, ‘Palatino Regular’ and ‘Palatino Italic’ are two distinct faces from the same family, called ‘Palatino’ itself.
比如,Palatino Regular和Palatino Italic是两个不同的字体,但它们来自相同的字体族Palatino.

A digital font is thus a data file that may contain one or more font faces.
电脑中的字体文件可能包含一个或者多个字体(font faces)。

For each of these, it contains character images, character metrics, as well as other kind of information important to the layout of text and the processing of specific character encodings.
对于每个字体,文件会包含字符图形,字符指标,以及其他用于文本布局相关和特定字符编码的重要的信息。

In some formats, like Adobe's Type 1, a single font face is described through several files (i.e., one contains the character images, another one the character metrics). We will ignore this implementation issue in most parts of this document and consider digital fonts as single files, though FreeType 2 is able to support multiple-files fonts correctly.
对于一些格式,一个字体会被存储在多个文件中。我们暂时无视这个问题。

As a convenience, a font file containing more than one face is called a font collection.
为了更加便利,一个字体文件会包含多个字体,这被称做字体集合。

This case is rather rare but can be seen in many Asian fonts, which contain images for two or more representation forms of a given script (usually for horizontal and vertical layout).
这种情况非常少见,但是在亚洲字体中可以看到。

字符图形和映射 Character images and mappings

The character images are called glyphs.
字符图形被称为Glyphs。

A single character can have several distinct images, i.e., several glyphs, depending on script, usage or context.
一个字符由于书体,用法以及上下文可以有多个图形。

Several characters can also take a single glyph (good examples are Roman ligatures like ‘fi’ and ‘fl’ which can be represented by a single glyph).
多个字符也可以使用同一个图形。

The relationship between characters and glyphs can be very complex but won't be discussed in this document.
字符和图形之间的关系可以是非常复杂,但本文档不会讨论。

Moreover, some formats use more or less complicated schemes to store and access glyphs. For the sake of clarity, we only retain the following notions when working with FreeType:
并且,一些格式使用了或多或少复杂的方案来存储字符图形。为了保持简单,我们只使用下面这些概念:

  • A font file contains a set of glyphs; each one can be stored as a bitmap, a vector representation, or any other scheme (most scalable formats use a combination of mathematical representation and control data/programs). These glyphs can be stored in any order in the font file, and are typically accessed through a simple glyph index.
    字体文件包含一组字符图形;每个图形可以被存储为位图,矢量形式,或者其他方案。这些字符图形可以以任何顺序被存储在字体文件中,然后通过简单的图形索引访问。

  • The font file contains one or more tables, called character maps (also called ‘charmaps’ or ‘cmaps’ for short), which are used to convert character codes for a given encoding (e.g., ASCII, Unicode, Big5, ShiftJIS, etc.) into glyph indices relative to the font file. A single font face may contain several charmaps. For example, many OpenType fonts contain an Apple-specific charmap as well as a Unicode charmap, which makes them usable on both Mac and Windows platforms.
    字体文件包含一个或多个表格,被称为字符映射,用于将字符编码转化为图形索引。一个字体可能包含多个字符映射。比如OpenType字体包含一个Apple公司的字符映射以及Unicode的字符映射,这样字体就可以工作在Mac和Windows上。

字符和字体指标 Character and font metrics

Each glyph image is associated with various metrics which describe how to place and manage it when rendering text; see section III for more.
每个字符图形会有多个指标(metrics)来描述在渲染文本时如何放置和管理图形。详情见Section 3.

Metrics relate to glyph placement, cursor advances, as well as text layout. They are extremely important to compute the flow of text when rendering a string of text.
图形放置,cursor advances 以及 文本布局相关的指标 对于计算一串字符串的整个文本布局很重要。

Each scalable format also contains some global metrics, expressed in notional (i.e. font) units, to describe some properties of all glyphs in the same face.
每个可缩放的格式也会包含全局的指标,它们以某种单位形式表达,来描述该字体里所有图形的属性。

Examples for global metrics are the maximum glyph bounding box, the ascender, descender, and text height of the font.
全局指标的例子有最大图形包围盒,the ascender, descender,以及字体的文本高度。

Non-scalable formats contain metrics also. However, they only apply to a set of given character dimensions and resolutions, and are usually expressed in pixels then.
不可缩放的格式也会包含这样的指标。虽然它们只会应用于一些给定的字符的大小,并且经常是像素为单位。

posted @ 2024-03-23 23:56  dewxin  阅读(12)  评论(0编辑  收藏  举报