Movatterモバイル変換


[0]ホーム

URL:


Docs.rs

[][src]Crateglyph_brush

useglyph_brush::{BrushAction,BrushError,GlyphBrushBuilder,Section};letdejavu:&[u8]=include_bytes!("../../fonts/DejaVuSans.ttf");letmutglyph_brush=GlyphBrushBuilder::using_font_bytes(dejavu).build();glyph_brush.queue(Section {text:"Hello glyph_brush",    ..Section::default()});glyph_brush.queue(some_other_section);matchglyph_brush.process_queued(|rect,tex_data|update_texture(rect,tex_data),|vertex_data|into_vertex(vertex_data),) {Ok(BrushAction::Draw(vertices))=> {// Draw new vertices.    }Ok(BrushAction::ReDraw)=> {// Re-draw last frame's vertices unmodified.    }Err(BrushError::TextureTooSmall {suggested })=> {// Enlarge texture + glyph_brush texture cache and retry.    }}

Modules

rusttype

Re-exported rusttype types.

Macros

delegate_glyph_brush_builder_fns

Macro to delegate builder methods to an innerglyph_brush::GlyphBrushBuilder

Structs

FontId

Id for a font

GlyphBrush

Object allowing glyph drawing, containing cache state. Manages glyph positioning cacheing,glyph draw caching & efficient GPU texture cache updating.

GlyphBrushBuilder

Builder for aGlyphBrush.

GlyphCalculator

Cut down version of aGlyphBrush that can calculate pixel bounds,but is unable to actually render anything.

GlyphCalculatorBuilder

Builder for aGlyphCalculator.

GlyphCalculatorGuard

GlyphCalculator scoped cache lock.

GlyphVertex

Data used to generate vertex information for a single glyph

OwnedSectionText
OwnedVariedSection
Section

An object that contains all the info to render a section of text.

SectionGeometry
SectionText
VariedSection

An object that contains all the info to render a varied section of text. That is one includingmany parts with differing fonts/scales/colors bowing to a single layout.

Enums

BrushAction

Actions that should be taken after processing queue data

BrushError
BuiltInLineBreaker

Built-in linebreaking logic.

GlyphChange
HorizontalAlign

Describes horizontal alignment preference for positioning & bounds.

Layout

Built-inGlyphPositioner implementations.

LineBreak

Indicator that a character is a line break, soft or hard. Includes the offset (byte-index)position.

VerticalAlign

Describes vertical alignment preference for positioning & bounds. Currently a placeholderfor future functionality.

Traits

FontMap

Mapper ofFontId ->Font

GlyphCruncher

Common glyph layout logic.

GlyphPositioner

Logic to calculate glyph positioning usingFont,SectionGeometry andSectionText.

LineBreaker

Producer of aLineBreak iterator. Used to allow to theLayout to be line break aware in a generic way.

Type Definitions

Color

RGBA[0, 1] color data.

DefaultSectionHasher

A "practically collision free"Section hasher

PositionedGlyphIter

PositionedGlyph iterator.


[8]ページ先頭

©2009-2025 Movatter.jp