Ý con kiến phản hồi sẽ được gửi cho nasaconstellation.com: bằng phương pháp nhấn nút gửi, chủ ý phản hồi của các bạn sẽ được sử dụng để cải thiện các sản phẩm và dịch vụ của nasaconstellation.com. Chế độ về quyền riêng rẽ tư.

Bạn đang xem: Glyphs tiếng anh là gì


Trong bài viết này

Glyphs & glyph runs are available at the lowest layer of functionality of the DirectWrite API, the glyph-rendering layer.

Glyphs

A glyph is a physical representation of a character in a given font. Characters might have many glyphs, with each font on a system potentially defining a different glyph for that character.

Two or more glyphs can also be combined into a single glyph, this process is called glyph composition. This can also be done in the opposite direction, a single glyph being split into multiple glyphs, known as glyph decomposition.

Alternate Glyphs

Fonts may provide alternate glyphs for characters, such as the stylistic alternate glyphs for the Pericles OpenType font, as shown in the following screen shot. The "A", "E", và "O" characters are rendered with stylistic alternate glyphs.

*

Another example of alternate glyphs are swash glyphs. The following screen shot shows standard và swash glyphs for the Pescadero font.

*

Swashes and other typographic features, including more elaborate alternate glyphs, are available through OpenType. OpenType typographic features can be applied lớn a text range by using the IDWriteTextLayout::SetTypography and passing the DWRITE_FONT_FEATURE_TAG enumeration constant associated with the desired feature.

Glyph Runs

A glyph run represents a contiguous phối of glyphs that all have the same phông face and size, as well as the same client drawing effect, if any. Underline & strikethrough are not part of the glyph run for the text range they are applied to, và are drawn later. Inline objects, such as images, are also drawn separately, as they are not part of a font.

The IDWriteFontFace Interface

DirectWrite uses the same system for phông classification as Windows Pesentation Foundation (WPF), so there can be multiple physical fonts per each fonts family. A phông face, such as the IDWriteFontFace interface in DirectWrite, represents a physical font, with a specific weight, slant, & stretch. It contains the fonts face type, appropriate file references, face identification data và various phông data such as metrics, names & glyph outlines.

The IDWriteFontFace can be created directly from a font name or obtained from a fonts collection.

Glyph Metrics

Individual glyphs have metrics associated with them. You can obtain the metrics for all of the glyphs in a glyph run by using the IDWriteFontFace::GetDesignGlyphMetrics method. This returns a DWRITE_GLYPH_METRICS structure that has the advance width, the left & right side bearing, the top and bottom side bearing, the height & the vertical baseline origin.

The following diagram shows various metrics of two different glyph characters.

*

Drawing a Glyph Run

When implementing a custom text renderer, the rendering of glyphs is handled by the IDWriteTextRenderer::DrawGlyphRun, a callback method that you implement as part of a class derived from IDWriteTextRenderer. The DWRITE_GLYPH_RUN structure that is passed khổng lồ DrawGlyphRun contains a IDWriteFontFace object, named fontFace, that represents the phông face for the entire glyph run.

Xem thêm: To Be In Search Of Là Gì Diễn Giải In Search Of Incredible Là Gì

The IDWriteFontFace object also provides the GetGlyphRunOutline method, which computes the glyph outlines by using a specified geometry sink callback, such as ID2D1SimplifiedGeometrySink when rendering with Direct2D.