Base rc.title_height on font vertical extents

This commit is contained in:
Johan Malm 2020-08-05 20:14:17 +01:00
parent 4d1363dcae
commit 2297e43cc0
11 changed files with 123 additions and 26 deletions

2
tools/pango/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
*.o
font-height

15
tools/pango/Makefile Normal file
View file

@ -0,0 +1,15 @@
CFLAGS += -g -Wall -O0 -std=c11
CFLAGS += `pkg-config cairo pango pangocairo --cflags`
CFLAGS += -I../../include
LIBS += `pkg-config cairo pango pangocairo --libs`
LDFLAGS += $(LIBS)
PROGS = font-height
all: $(PROGS)
font-height: font-height.c ../../src/common/font.c
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
clean:
rm -f $(PROGS) *.o

13
tools/pango/font-height.c Normal file
View file

@ -0,0 +1,13 @@
#include <stdio.h>
#include <stdlib.h>
#include "common/font.h"
int main(int argc, char **argv)
{
if (argc < 2) {
printf("Usage: %s <font-description> (e.g. 'sans 10')\n", argv[0]);
exit(1);
}
printf("height=%d\n", font_height(argv[1]));
}