Changeset 6a87f28 in mainline for uspace/lib/gfxfont/src/font.c
- Timestamp:
- 2021-02-25T16:48:13Z (3 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- bac8acab
- Parents:
- 26853ebc
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/gfxfont/src/font.c
r26853ebc r6a87f28 180 180 } 181 181 182 /** Create dummy font for printing text in text mode. 183 * 184 * @param tface Typeface 185 * @param rfont Place to store pointer to new font 186 * 187 * @return EOK on success, EINVAL if parameters are invald, 188 * ENOMEM if insufficient resources, EIO if graphic device connection 189 * was lost 190 */ 191 errno_t gfx_font_create_textmode(gfx_typeface_t *tface, gfx_font_t **rfont) 192 { 193 gfx_font_props_t props; 194 gfx_font_metrics_t metrics; 195 196 gfx_font_props_init(&props); 197 props.size = 1; 198 props.flags = gff_text_mode; 199 200 gfx_font_metrics_init(&metrics); 201 metrics.ascent = 0; 202 metrics.descent = 0; 203 metrics.leading = 1; 204 205 return gfx_font_create(tface, &props, &metrics, rfont); 206 } 207 182 208 /** Open font. 183 209 * … … 229 255 void gfx_font_get_metrics(gfx_font_t *font, gfx_font_metrics_t *metrics) 230 256 { 231 *metrics = font->metrics; 257 if (font != NULL) { 258 *metrics = font->metrics; 259 } else { 260 metrics->ascent = 0; 261 metrics->descent = 0; 262 metrics->leading = 1; 263 } 232 264 } 233 265
Note:
See TracChangeset
for help on using the changeset viewer.