Generated by Doxygen 1.8.14
Neographics
fonts.h
1 #pragma once
2 #include <pebble.h>
3 #include "../types.h"
4 #include "../macros.h"
5 #include "../common.h"
6 #include "../context.h"
7 
8 /*-----------------------------------------------------------------------------.
9 | |
10 | Fonts |
11 | |
12 | Abstracts away font magicks. |
13 | |
14 `-----------------------------------------------------------------------------*/
15 
24 typedef struct n_GFontInfo {
25  uint8_t version;
26  uint8_t line_height;
27  uint16_t glyph_amount;
28  uint16_t wildcard_codepoint;
29  // v2+
30  uint8_t hash_table_size;
31  uint8_t codepoint_bytes;
32  // v3+
33  uint8_t fontinfo_size;
34  uint8_t features;
35 } __attribute__((__packed__)) n_GFontInfo;
36 
41 typedef struct n_GFontHashTableEntry {
42  uint8_t hash_value;
43  uint8_t offset_table_size;
44  uint16_t offset_table_offset;
45 } __attribute__((__packed__)) n_GFontHashTableEntry;
46 
50 #define __FONT_INFO_V1_LENGTH 6
51 
54 #define __FONT_INFO_V2_LENGTH 8
55 
60 typedef enum {
61  n_GFontFeature2ByteGlyphOffset = 0b1,
62  n_GFontFeatureRLE4Encoding = 0b10,
64 
68 typedef struct n_GGlyphInfo {
69  uint8_t width;
70  uint8_t height;
71  int8_t left_offset;
72  int8_t top_offset;
73  int8_t advance;
74  uint8_t data[];
75 } __attribute__((__packed__)) n_GGlyphInfo;
76 
80 typedef n_GFontInfo * n_GFont;
81 
86 
90 n_GGlyphInfo * n_graphics_font_get_glyph_info(n_GFont font, uint32_t charcode);
91 
96 
Definition: fonts.h:68
n_GFontInfo * n_GFont
Definition: fonts.h:80
n_GGlyphInfo * n_graphics_font_get_glyph_info(n_GFont font, uint32_t charcode)
Definition: fonts.h:24
Definition: context.h:28
Definition: fonts.h:41
void n_graphics_font_draw_glyph(n_GContext *ctx, n_GGlyphInfo *glyph, n_GPoint p)
Definition: fonts.c:84
typedef __attribute__
Definition: point.h:24
uint8_t n_graphics_font_get_line_height(n_GFont font)
n_GFontFeatures
Definition: fonts.h:60