Introduction
Introduction Statistics Contact Development Disclaimer Help
font.c - ploot - simple plotting tools
git clone git://bitreich.org/ploot git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65…
Log
Files
Refs
Tags
README
LICENSE
---
font.c (324B)
---
1 #include "font.h"
2 #include <string.h>
3
4 size_t
5 font_width(struct font *ft, int c)
6 {
7 size_t len;
8
9 len = strlen(ft->glyph[(c < 0 || c > 127) ? 0 : c]) / ft->height;
10 return len;
11 }
12
13 size_t
14 font_strlen(struct font *ft, char *s)
15 {
16 size_t len;
17
18 len = 0;
19 for (; *s != '\0'; s++)
20 len += font_width(ft, *s) + 1;
21 return len;
22 }
You are viewing proxied material from bitreich.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.