[][src]Module azul_core::app_resources

Functions to manage adding fonts + images, garbage collection

Structs

AddFont
AddFontInstance
AddImage
AddImageMsg
AppResources

Stores the resources for the application, souch as fonts, images and cached texts, also clipboard strings

Au
ClusterInfo

Info about what cluster a certain glyph belongs to.

ClusterIterator

Iterator over glyphs that returns information about the cluster that this glyph belongs to. Returned by the ScaledWord::cluster_iter() function.

DeleteImageMsg
Epoch
ExternalImageData

Descriptor for external image resources. See ImageData.

ExternalImageId

An arbitrary identifier for an external image provided by the application. It must be a unique identifier for each external image.

FakeRenderApi

Used only for debugging, so that the AppResource garbage collection tests can run without a real RenderApi

FontId
FontInstanceKey
FontInstanceOptions
FontInstancePlatformOptions
FontKey
FontMetrics
FontVariation
GlyphInfo
GlyphOptions
GlyphPosition
IdNamespace
ImageDescriptor

Metadata (but not storage) describing an image In WebRender.

ImageDescriptorFlags

Various flags that are part of an image descriptor.

ImageId
ImageInfo
ImageKey
LayoutedGlyphs

Returns the layouted glyph instances

LoadFontFn
LoadImageFn
LoadedFont
LoadedFontSource
LoadedImageSource
PrimitiveFlags
RawImage

Raw image made up of raw pixels (either BRGA8 or A8)

ScaledWord

Word that is scaled (to a font / font instance), but not yet positioned

ScaledWords

A paragraph of words that are shaped and scaled (* but not yet layouted / positioned*!) according to their final size in pixels.

SyntheticItalics
TextCache

Cache for accessing large amounts of text

TextId
UpdateImage
Word

Section of a certain type

WordPositions

Stores the positions of the vertically laid out texts

Words

Text broken up into Tab, Word(), Return characters

Enums

AddFontMsg
DeleteFontMsg
ExternalImageType

Storage format identifier for externally-managed images.

FontHinting
FontLCDFilter
FontRenderMode
FontSource
ImageData

Represents the backing store of an arbitrary series of pixels for display by WebRender. This storage can take several forms.

ImageDirtyRect
ImageSource
ImmediateFontId
RawImageFormat
ResourceUpdate
TextureTarget

Specifies the type of texture target in driver terms.

WordType

Either a white-space delimited word, tab or return character

Constants

AU_PER_PX
FONT_INSTANCE_FLAG_EMBEDDED_BITMAPS
FONT_INSTANCE_FLAG_FLIP_X
FONT_INSTANCE_FLAG_FLIP_Y
FONT_INSTANCE_FLAG_FONT_SMOOTHING
FONT_INSTANCE_FLAG_FORCE_AUTOHINT
FONT_INSTANCE_FLAG_FORCE_GDI
FONT_INSTANCE_FLAG_LCD_VERTICAL
FONT_INSTANCE_FLAG_NO_AUTOHINT
FONT_INSTANCE_FLAG_SUBPIXEL_BGR
FONT_INSTANCE_FLAG_SUBPIXEL_POSITION
FONT_INSTANCE_FLAG_SYNTHETIC_BOLD
FONT_INSTANCE_FLAG_TRANSPOSE
FONT_INSTANCE_FLAG_VERTICAL_LAYOUT
MAX_AU
MIN_AU

Traits

FontImageApi

Functions

add_fonts_and_images

Scans the DisplayList for new images and fonts. After this call, the RenderApi is guaranteed to know about all FontKeys and FontInstanceKey

add_resources

Submits the AddFont, AddFontInstance and AddImage resources to the RenderApi. Extends currently_registered_images and currently_registered_fonts by the last_frame_image_keys and last_frame_font_keys, so that we don't lose track of what font and image keys are currently in the API.

build_add_font_resource_updates

Given the fonts of the current frame, returns AddFont and AddFontInstances of which fonts / instances are currently not in the current_registered_fonts and need to be added.

build_add_image_resource_updates

Given the images of the current frame, returns AddImages of which image keys are currently not in the current_registered_fonts and need to be added. Modifies last_frame_image_keys to contain the added image keys

build_delete_font_resource_updates
build_delete_image_resource_updates

At the end of the frame, all images that are registered, but weren't used in the last frame

delete_resources
font_size_to_au
garbage_collect_fonts_and_images

To be called at the end of a frame (after the UI has rendered): Deletes all FontKeys and FontImageKeys that weren't used in the last frame, to save on memory. If the font needs to be recreated, it needs to be reloaded from the FontSource.

get_font_id
get_font_size
is_image_opaque
premultiply
scan_ui_description_for_font_keys

Scans the display list for all font IDs + their font size

scan_ui_description_for_image_keys

Scans the display list for all image keys

Type Definitions

CssFontId
CssImageId
FontInstanceFlags
GlyphIndex
IndexOfLineBreak
LineBreaks
LineLength
RemainingSpaceToRight
TileSize
WordIndex

Unions

HbVarIntT