Loading...
Searching...
No Matches
zone.c File Reference

Layout primitives implementation. More...

#include "ui/zone.h"

Functions

TextLayer * zone_make_layer (Layer *parent, const Zone *zone)
 Creates a transparent text layer for a zone and attaches it to the parent layer.
static int text_width (const char *text, GFont font, GTextAlignment align)
 The rendered single-line width of text in a font. Height is irrelevant for the fit test, so this only measures the width.
void zone_set_text_fit (TextLayer *layer, const Zone *zone, const char *text)
 Sets a text layer's text, stepping down through the zone's font tiers to find one the text fits in.

Detailed Description

Layout primitives implementation.

Function Documentation

◆ text_width()

int text_width ( const char * text,
GFont font,
GTextAlignment align )
static

The rendered single-line width of text in a font. Height is irrelevant for the fit test, so this only measures the width.

Parameters
textThe text to measure.
fontThe font to measure it in.
alignThe text alignment, which the layout call needs even though it does not change the measured width.
Returns
The width, in pixels.