├── fonts ├── DejaVuSerif.ttf ├── UbuntuMonoB.ttf └── UbuntuMonoR.ttf ├── tests ├── params ├── generate-all ├── Makefile.am ├── test-data │ ├── fontlist │ ├── 0da8608277aeab5c1e8e3c5d91bc5e7b │ ├── 6ece5fb6ced916236e10d0381edfb353 │ ├── d1af4c835a961a8f374c3c010473d1ae │ ├── ed8139e1ad15fa69294a4eafd9b9efeb │ ├── 008a14c4e0ae783293f753c270f0ba89 │ ├── 212b1b5dcbe34c06a4a4cbc45b689f70 │ ├── 48f550d629c2ea64b042641b2cd110a0 │ ├── 7fa82c5af0b3a82c6802298fa0b0cd5b │ ├── a29399fb27450e3ccf6783d227ea4553 │ ├── c42f4ba573999d6fe920e7c86f5198cf │ ├── 41fcb752d1b2ab9c06ddeae947fd35da │ └── 65b10a2c6adfa411bba7a7fe7f2801cc └── test-all ├── do-configure-debug ├── include ├── Makefile.am ├── cc_config.h.in └── config.h ├── examples ├── font-ubuntumono-10.h └── font-ubuntumono-10.c ├── .gitignore ├── .circleci └── config.yml ├── bootstrap ├── Makefile.am ├── LICENSE ├── src ├── fontfinder.c ├── fontrender.c ├── fontrender_l.c ├── fontrender_rgba32.c ├── fontrender_rgb16.c ├── Makefile.am ├── fonttest.c ├── resource │ └── fontem.h └── fontem.c ├── make-all ├── README.md ├── configure.ac └── aclocal └── ax_cflags_gcc_option.m4 /fonts/DejaVuSerif.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrisy/fontem/HEAD/fonts/DejaVuSerif.ttf -------------------------------------------------------------------------------- /fonts/UbuntuMonoB.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrisy/fontem/HEAD/fonts/UbuntuMonoB.ttf -------------------------------------------------------------------------------- /fonts/UbuntuMonoR.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrisy/fontem/HEAD/fonts/UbuntuMonoR.ttf -------------------------------------------------------------------------------- /tests/params: -------------------------------------------------------------------------------- 1 | # Common values for the test scripts 2 | 3 | ft=../src/fonttest 4 | str="Test 0123!@_$%^&*{}" 5 | -------------------------------------------------------------------------------- /do-configure-debug: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # This file is distributed under the terms of the MIT License. 4 | # See the LICENSE file at the top of this tree, or if it is missing a copy can 5 | # be found at http://opensource.org/licenses/MIT 6 | # 7 | 8 | exec ./configure --enable-debug $* 9 | -------------------------------------------------------------------------------- /include/Makefile.am: -------------------------------------------------------------------------------- 1 | # Makefile.am - include 2 | # 3 | # This file is distributed under the terms of the MIT License. 4 | # See the LICENSE file at the top of this tree, or if it is missing a copy can 5 | # be found at http://opensource.org/licenses/MIT 6 | 7 | include_HEADERS = config.h 8 | nodist_include_HEADERS = ac_config.h cc_config.h 9 | 10 | distclean-local: 11 | rm -f Makefile.in ac_config.h.in* cc_config.h.in~ 12 | -------------------------------------------------------------------------------- /tests/generate-all: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | . params 4 | 5 | datadir="$1" 6 | 7 | if [ -z "${datadir}" ]; then 8 | echo "ERROR: Need a data directory as \$1" >&2 9 | exit 1 10 | fi 11 | 12 | fontlist="${datadir}/fontlist" 13 | "${ft}" -a > "${fontlist}" 14 | readarray fonts < "${fontlist}" 15 | 16 | for i in "${fonts[@]}"; do 17 | md5sum=$(echo $i | md5sum | awk '{print $1}') 18 | eval "${ft}" $i -t "\"${str}\"" > "${datadir}/${md5sum}" 19 | done 20 | -------------------------------------------------------------------------------- /examples/font-ubuntumono-10.h: -------------------------------------------------------------------------------- 1 | /* AUTOMATICALLY GENERATED FILE! EDITING NOT RECOMMENDED! 2 | * 3 | * This file is distributed under the terms of the MIT License. 4 | * See the LICENSE file at the top of this tree, or if it is missing a copy can 5 | * be found at http://opensource.org/licenses/MIT 6 | */ 7 | 8 | #ifndef _FONTEM_UbuntuMonoB_10_H 9 | #define _FONTEM_UbuntuMonoB_10_H 10 | 11 | #include "fontem.h" 12 | 13 | extern struct font font_UbuntuMonoB_10; 14 | 15 | #endif /* _FONTEM_UbuntuMonoB_10_H */ 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | aclocal.m4 2 | aclocal/libtool.m4 3 | aclocal/ltoptions.m4 4 | aclocal/ltsugar.m4 5 | aclocal/ltversion.m4 6 | aclocal/lt~obsolete.m4 7 | autom4te.cache/ 8 | build-aux/ 9 | config.log 10 | config.status 11 | configure 12 | Makefile.in 13 | Makefile 14 | libtool 15 | include/ac_config.h 16 | include/ac_config.h.in 17 | include/cc_config.h 18 | *.o 19 | *.lo 20 | *.a 21 | *.la 22 | *.so 23 | include/stamp-h1 24 | *.h.in~ 25 | *.sw[op] 26 | .deps 27 | .libs 28 | .dirstamp 29 | *.tar.gz 30 | doc/*.tag 31 | doc/html 32 | src/fonts 33 | src/fontem 34 | src/fonttest 35 | -------------------------------------------------------------------------------- /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | jobs: 3 | build: 4 | docker: 5 | - image: ubuntu:xenial 6 | environment: 7 | - LC_CTYPE: C 8 | - LC_ALL: en_US.UTF-8 9 | - LANG: en_US 10 | - IS_CI: circleci 11 | steps: 12 | - run: 13 | name: Package dependencies 14 | command: apt-get update && apt-get install -y build-essential autoconf automake libtool locales libpopt-dev libfreetype6-dev 15 | - run: 16 | name: Setup locale 17 | command: locale-gen $LC_ALL 18 | - checkout 19 | - run: 20 | name: Build 21 | command: ./make-all 22 | - run: 23 | name: Test 24 | command: make test 25 | -------------------------------------------------------------------------------- /bootstrap: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # This file is distributed under the terms of the MIT License. 4 | # See the LICENSE file at the top of this tree, or if it is missing a copy can 5 | # be found at http://opensource.org/licenses/MIT 6 | # 7 | # Bootstrap the build tools 8 | # Run in the root directory of the project 9 | 10 | echo "Bootstraping..." 11 | aclocal=aclocal 12 | libtoolize=libtoolize 13 | [ $(uname -s) = 'Darwin' ] && libtoolize=glibtoolize 14 | 15 | set -e 16 | mkdir -p build-aux 17 | echo "-- aclocal" 18 | aclocal -I $aclocal --install 19 | echo "-- libtoolize" 20 | $libtoolize 21 | echo "-- autoconf" 22 | autoconf 23 | echo "-- autoheader" 24 | autoheader 25 | echo "-- automake" 26 | automake --add-missing 27 | touch configure 28 | -------------------------------------------------------------------------------- /include/cc_config.h.in: -------------------------------------------------------------------------------- 1 | /** 2 | * vim: set softtabstop=4 shiftwidth=4 tabstop=4 expandtab: 3 | * \file include/cc_config.h 4 | * 5 | * This file is distributed under the terms of the MIT License. 6 | * See the LICENSE file at the top of this tree, or if it is missing a copy can 7 | * be found at http://opensource.org/licenses/MIT 8 | */ 9 | 10 | #ifndef CC_CONFIG_H 11 | #define CC_CONFIG_H 12 | 13 | /* Set the CC_INLINE macro */ 14 | #ifdef __cplusplus 15 | # define CC_INLINE inline 16 | #else 17 | # define CC_INLINE @cc_inline@ 18 | #endif 19 | 20 | /* Setup our NOINLINE macro */ 21 | #ifdef __GNUC__ 22 | # define CC_NOINLINE __attribute__ ((noinline)) 23 | #else 24 | # define CC_NOINLINE 25 | #endif 26 | 27 | #endif /* CC_CONFIG_H */ 28 | -------------------------------------------------------------------------------- /tests/Makefile.am: -------------------------------------------------------------------------------- 1 | # test Makefile.am 2 | # vim:set softtabstop=8 shiftwidth=8 tabstop=8 noexpandtab: 3 | # 4 | # This file is distributed under the terms of the MIT License. 5 | # See the LICENSE file at the top of this tree, or if it is missing a copy can 6 | # be found at http://opensource.org/licenses/MIT 7 | # 8 | 9 | test_data_dir = test-data 10 | 11 | 12 | # (Re)-generate test data 13 | generate-test-data: 14 | mkdir -p "$(test_data_dir)" 15 | find "$(test_data_dir)" -type f -print0 | xargs -0r rm 16 | ./generate-all "$(test_data_dir)" 17 | 18 | test: 19 | @if [ ! -d "$(test_data_dir)" -o ! -f "$(test_data_dir)"/fontlist ]; then \ 20 | echo -n "ERROR: No test data to compare with. " >&2; \ 21 | echo "Perhaps try 'make generate-test-data'." >&2; \ 22 | echo >&2; \ 23 | exit 1; \ 24 | fi 25 | ./test-all "$(test_data_dir)" 26 | -------------------------------------------------------------------------------- /tests/test-data/fontlist: -------------------------------------------------------------------------------- 1 | --fontname="DejaVu Serif" --fontstyle="Book" --fontsize=10 --fontrle=0 2 | --fontname="DejaVu Serif" --fontstyle="Book" --fontsize=10 --fontrle=1 3 | --fontname="DejaVu Serif" --fontstyle="Book" --fontsize=16 --fontrle=0 4 | --fontname="DejaVu Serif" --fontstyle="Book" --fontsize=16 --fontrle=1 5 | --fontname="Ubuntu Mono" --fontstyle="Bold" --fontsize=10 --fontrle=0 6 | --fontname="Ubuntu Mono" --fontstyle="Bold" --fontsize=10 --fontrle=1 7 | --fontname="Ubuntu Mono" --fontstyle="Bold" --fontsize=16 --fontrle=0 8 | --fontname="Ubuntu Mono" --fontstyle="Bold" --fontsize=16 --fontrle=1 9 | --fontname="Ubuntu Mono" --fontstyle="Regular" --fontsize=10 --fontrle=0 10 | --fontname="Ubuntu Mono" --fontstyle="Regular" --fontsize=10 --fontrle=1 11 | --fontname="Ubuntu Mono" --fontstyle="Regular" --fontsize=16 --fontrle=0 12 | --fontname="Ubuntu Mono" --fontstyle="Regular" --fontsize=16 --fontrle=1 13 | -------------------------------------------------------------------------------- /tests/test-all: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | . params 4 | 5 | datadir="$1" 6 | 7 | if [ -z "${datadir}" ]; then 8 | echo "ERROR: Need a data directory as \$1" >&2 9 | exit 1 10 | fi 11 | 12 | fontlist="${datadir}/fontlist" 13 | 14 | echo "Fonts in test suite:" 15 | cat "${fontlist}" 16 | echo 17 | echo "Fonts built:" 18 | "${ft}" -a 19 | echo 20 | "${ft}" -l 21 | echo 22 | 23 | readarray fonts < "${fontlist}" 24 | 25 | tmp=$(mktemp --suffix fontem) 26 | cleanup() { 27 | rm -f "${tmp}" 28 | } 29 | trap cleanup EXIT 30 | 31 | rc=0 32 | for i in "${fonts[@]}"; do 33 | md5sum=$(echo $i | md5sum | awk '{print $1}') 34 | echo -n "Testing md5=${md5sum} for $i" 35 | eval "${ft}" $i -t "\"${str}\"" > "${tmp}" 36 | cmp "${tmp}" "${datadir}/${md5sum}" || ( 37 | echo -n "ERROR: Font failed compare: ${md5sum} $i" >&2; 38 | echo "---- ${tmp}"; 39 | cat "${tmp}"; 40 | echo "----"; 41 | exit 1) || rc=1 42 | done 43 | 44 | [ $rc = 0 ] && echo "All fonts passed compare tests." 45 | 46 | exit ${rc} 47 | -------------------------------------------------------------------------------- /include/config.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file include/config.h 3 | * 4 | * This file is distributed under the terms of the MIT License. 5 | * See the LICENSE file at the top of this tree, or if it is missing a copy can 6 | * be found at http://opensource.org/licenses/MIT 7 | */ 8 | 9 | 10 | #ifndef CONFIG_H 11 | #define CONFIG_H 12 | 13 | #ifdef _DEBUG 14 | # define DEBUG 1 15 | #else 16 | # define DEBUG 0 17 | #endif 18 | 19 | /* Bit of a hack for macos - inline seems b0rked - probably 20 | * something I'm doing wrong 21 | */ 22 | #if !defined __GNUC_GNU_INLINE__ && defined __clang__ 23 | # define __GNUC_GNU_INLINE__ 1 24 | #endif 25 | 26 | #ifdef HAVE_CONFIG_H 27 | #include "ac_config.h" 28 | #endif 29 | 30 | #ifdef HAVE_SYS_TYPES_H 31 | # include 32 | #endif 33 | #ifdef HAVE_STDLIB_H 34 | # include 35 | #endif 36 | #ifdef HAVE_STDINT_H 37 | # include 38 | #endif 39 | 40 | #include "cc_config.h" 41 | 42 | #endif /* CONFIG_H */ 43 | 44 | // vim: set softtabstop=4 shiftwidth=4 tabstop=4 expandtab: 45 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | # root Makefile.am 2 | # vim:set softtabstop=8 shiftwidth=8 tabstop=8 noexpandtab: 3 | # 4 | # This file is distributed under the terms of the MIT License. 5 | # See the LICENSE file at the top of this tree, or if it is missing a copy can 6 | # be found at http://opensource.org/licenses/MIT 7 | # 8 | 9 | ACLOCAL_AMFLAGS = -I aclocal 10 | 11 | sources = include src 12 | SUBDIRS = $(sources) 13 | 14 | EXTRA_DIST = README.md LICENSE \ 15 | bootstrap do-configure-debug make-all \ 16 | amlocal/uncrustify.cfg \ 17 | fonts/*.ttf 18 | 19 | # Uncrustify the source 20 | uncrustify: amlocal/uncrustify.cfg 21 | @for dir in $(sources) src/resource; do \ 22 | find "$(top_srcdir)/$$dir" -type f -name '*.[ch]' ! -path '*/fonts/*' -print0 | \ 23 | xargs -0 uncrustify -c $(top_srcdir)/amlocal/uncrustify.cfg --replace --no-backup; \ 24 | done 25 | 26 | test: 27 | $(MAKE) -C tests test 28 | 29 | LIBTOOL_DEPS = @LIBTOOL_DEPS@ 30 | libtool: $(LIBTOOL_DEPS) 31 | $(SHELL) ./config.status --recheck 32 | 33 | distclean-local: 34 | rm -f Makefile.in aclocal.m4 configure 35 | rm -rf autom4te.cache build-aux 36 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2014 Chris Luke 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | 24 | -------------------------------------------------------------------------------- /src/fontfinder.c: -------------------------------------------------------------------------------- 1 | /** 2 | * \file fontfinder.c 3 | * 4 | * This file is distributed under the terms of the MIT License. 5 | * See the LICENSE file at the top of this tree, or if it is missing a copy can 6 | * be found at http://opensource.org/licenses/MIT 7 | */ 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | #include "fontem.h" 16 | #include "font_all.h" 17 | 18 | /** Find a font based on name, style size and whether it is compressed. */ 19 | const struct font *font_find_all(const char *name, const char *style, const int size, 20 | const char rle) 21 | { 22 | for (int idx = 0; fonts[idx] != NULL; idx++) { 23 | if (size == fonts[idx]->size && !strcasecmp(name, fonts[idx]->name)) 24 | if (style == NULL || !strcasecmp(style, fonts[idx]->style)) 25 | if (rle < 0 || rle == fonts[idx]->compressed) 26 | return fonts[idx]; 27 | } 28 | return NULL; 29 | } 30 | 31 | /** Find a font based on name, style and size. */ 32 | const struct font *font_find(const char *name, const char *style, const int size) 33 | { 34 | return font_find_all(name, style, size, -1); 35 | } 36 | 37 | /** Iterate all the fonts we know about. */ 38 | void font_iterate_all(fia_fn_t fn, void *opaque) 39 | { 40 | for (int idx = 0; fonts[idx] != NULL; idx++) 41 | fn((struct font *)fonts[idx], opaque); 42 | } 43 | -------------------------------------------------------------------------------- /make-all: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # This file is distributed under the terms of the MIT License. 4 | # See the LICENSE file at the top of this tree, or if it is missing a copy can 5 | # be found at http://opensource.org/licenses/MIT 6 | # 7 | # Make everything 8 | 9 | dir=$(dirname $0) 10 | cd "${dir}" 11 | 12 | MAKE=make 13 | which gmake >/dev/null 2>&1 && MAKE=gmake 14 | export MAKE 15 | export LD_LIBRARY_PATH= 16 | #MAKE_PARALLEL=-j4 # TODO: make this depend on if it's in CI 17 | 18 | do_bootstrap= 19 | 20 | if [ -f configure ]; then 21 | # Find if any autotools input is newer than configure 22 | if find . -type f '(' -name 'Makefile.*' -or -name 'configure.*' -or -name '*.in' ')' -newer configure | grep -q "."; then 23 | echo "- autotools out of date; bootstrap required" 24 | do_bootstrap=y 25 | fi 26 | 27 | # Find if any autotools output file is missing 28 | outputs=$(eval $(grep ^ac_config_files= configure); echo $ac_config_files) 29 | for i in ${outputs}; do 30 | if [ ! -f "$i" ]; then 31 | echo "- '$i' is missing; bootstrap required" 32 | do_bootstrap=y 33 | fi 34 | done 35 | else 36 | echo "- 'configure' is missing; bootstrap required" 37 | do_bootstrap=y 38 | fi 39 | 40 | if [ "${do_bootstrap}" ]; then 41 | [ -f Makefile ] && $MAKE $MAKE_PARALLEL clean 42 | ./bootstrap 43 | ./do-configure-debug 44 | $MAKE $MAKE_PARALLEL clean 45 | fi 46 | 47 | exec $MAKE $MAKE_PARALLEL 48 | -------------------------------------------------------------------------------- /src/fontrender.c: -------------------------------------------------------------------------------- 1 | /** 2 | * \file fontrender.c 3 | * 4 | * This file is distributed under the terms of the MIT License. 5 | * See the LICENSE file at the top of this tree, or if it is missing a copy can 6 | * be found at http://opensource.org/licenses/MIT 7 | */ 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #include "fontem.h" 15 | 16 | const struct glyph *font_get_glyph(const struct font *font, glyph_t glyph) 17 | { 18 | if (glyph > font->max) 19 | return NULL; 20 | 21 | size_t first = 0, last = font->count; 22 | const struct glyph **glyphs = font->glyphs; 23 | 24 | while (first < last) { 25 | size_t mid = first + (last - first) / 2; 26 | if (glyph <= glyphs[mid]->glyph) 27 | last = mid; 28 | else 29 | first = mid + 1; 30 | } 31 | 32 | return (last < font->count && glyphs[last]->glyph == glyph) ? *(glyphs + last) : NULL; 33 | } 34 | 35 | int16_t font_get_kerning(const struct font *font, glyph_t left, glyph_t right) 36 | { 37 | if (font == NULL || left == 0 || right == 0) return 0; 38 | const struct glyph *g = font_get_glyph(font, right); 39 | if (g == NULL || g->kerning == NULL) return 0; 40 | 41 | const struct kerning *k; 42 | for (k = g->kerning; k->left != 0; k++) 43 | if (k->left == left) return k->offset; 44 | 45 | return 0; 46 | } 47 | 48 | int font_calculate_box(const struct font *font, 49 | int *maxx, int *maxy, 50 | const char *str) 51 | { 52 | if (font == NULL) return 0; 53 | if (str == NULL) return 0; 54 | 55 | int x = 0; 56 | int y = font->height; 57 | int count = 0; 58 | glyph_t prev = 0; 59 | for (const char *p = str; *p; p++, count++) { 60 | const struct glyph *g = font_get_glyph(font, *p); 61 | if (g == NULL) continue; 62 | x += g->advance + font_get_kerning(font, prev, *p); 63 | prev = *p; 64 | } 65 | 66 | *maxx = x; 67 | *maxy = y; 68 | 69 | return count; 70 | } 71 | -------------------------------------------------------------------------------- /tests/test-data/0da8608277aeab5c1e8e3c5d91bc5e7b: -------------------------------------------------------------------------------- 1 | 2 | 3 | X .XX XX. 4 | XXXXX X +X+ X .XXX .XXX X .XX XXX+ .X. .+ X .XX. X X X 5 | X X .+ +. .XX +. .X + .X X .X .+ X. X X X +++ X X +.+.+ X X 6 | X +XX .XXXX XXXXX X X + X X X X +. X X X X.+ X X X X .+. X X 7 | X ++ .+ X. X X + X X .+ .+ X X .XX .X+ .X+X ++ ++ .XX .+. .X X. 8 | X X X X+ X X X X X .X XX X X X X +X. .. + + +X+ X + + XX. .XX 9 | X XXXXX +X+ X X X X .X .X X X X X X X+X. +. ++X .X X. 10 | X X +X X X X X X X + X X X + .X +.X X X +X X X 11 | X .+ + X X. .+ +. X + .X X .XX +XXX X X X X+ XX X X 12 | X +XXX +XXX. .XXX +X+ XXXXX XXXXX +XX+ + +. X +. +X. +XX+.+ X X 13 | X X X X 14 | .XX XXXXXXX .XX XX. 15 | -------------------------------------------------------------------------------- /tests/test-data/6ece5fb6ced916236e10d0381edfb353: -------------------------------------------------------------------------------- 1 | 2 | 3 | XX .XXX XX. 4 | XXXXXX XX +XX+ XX XXX .XXX XX +XX+ XXX+. .X. .+ +X+ .XX. X XXXX XXX 5 | XXXXXX XX .XXXX. .XXX XXXXX XXXXX XX X. .+ +XXXXX X X X XXX XXXX +.X.+ XX XX 6 | XX .XX+ XXX+ XXXXXXX XX..XX ++XX . XX . XX XX ++ +XXX XX X X.+ +X.XX X..X XXXXX XX XX 7 | XX .XXXX+ XXXXX XXXXXXX XXXXXX XX X+ XXX. XX X +XXXX XXX+ .X+X .X+ +X. +XX. .X. XX XX 8 | XX XX XX XX. XX XXXXXX XX XX XXX. XX X XX. X .XXXX. +. .X X. XXX X. +X+ XXX. .XXX 9 | XX XXXXXX .XXX XX XX XX XX +X .XX XX X XX +X .XXX X .X. XX.XXX. XXX. .XXX 10 | XX XX. . .XX XX XX..XX XX .X XX X XX XX . XX +. X X XX .XX XX XX 11 | XX .XXXXX XXXXX XXXXX .XXXX. XXXXXX XXXXX XXXX+ XX X +XXXX XXXXX+ X X X +XXXXX. XX XX 12 | XX .XXX+ +XXX. .XXX+ +XX+ XXXXXX XXXXX +XX+ XX ++ +XX+ .XXX. +. +X. +XXX+X XX XX 13 | X. XXXXXXX XX XXXX XXX 14 | +XXX XXXXXXX .XXX XX. 15 | -------------------------------------------------------------------------------- /tests/test-data/d1af4c835a961a8f374c3c010473d1ae: -------------------------------------------------------------------------------- 1 | 2 | 3 | X .XX XX. 4 | XXXXX X +X+ X .XXX .XXX X .XX XXX+ .X. .+ X .XX. X X X 5 | X X .+ +. .XX +. .X + .X X .X .+ X. X X X +++ X X +.+.+ X X 6 | X +XX .XXXX XXXXX X X + X X X X +. X X X X.+ X X X X .+. X X 7 | X ++ .+ X. X X + X X .+ .+ X X .XX .X+ .X+X ++ ++ .XX .+. .X X. 8 | X X X X+ X X X X X .X XX X X X X +X. .. + + +X+ X + + XX. .XX 9 | X XXXXX +X+ X X X X .X .X X X X X X X+X. +. ++X .X X. 10 | X X +X X X X X X X + X X X + .X +.X X X +X X X 11 | X .+ + X X. .+ +. X + .X X .XX +XXX X X X X+ XX X X 12 | X +XXX +XXX. .XXX +X+ XXXXX XXXXX +XX+ + +. X +. +X. +XX+.+ X X 13 | X X X X 14 | .XX XXXXXXX .XX XX. 15 | -------------------------------------------------------------------------------- /tests/test-data/ed8139e1ad15fa69294a4eafd9b9efeb: -------------------------------------------------------------------------------- 1 | 2 | 3 | XX .XXX XX. 4 | XXXXXX XX +XX+ XX XXX .XXX XX +XX+ XXX+. .X. .+ +X+ .XX. X XXXX XXX 5 | XXXXXX XX .XXXX. .XXX XXXXX XXXXX XX X. .+ +XXXXX X X X XXX XXXX +.X.+ XX XX 6 | XX .XX+ XXX+ XXXXXXX XX..XX ++XX . XX . XX XX ++ +XXX XX X X.+ +X.XX X..X XXXXX XX XX 7 | XX .XXXX+ XXXXX XXXXXXX XXXXXX XX X+ XXX. XX X +XXXX XXX+ .X+X .X+ +X. +XX. .X. XX XX 8 | XX XX XX XX. XX XXXXXX XX XX XXX. XX X XX. X .XXXX. +. .X X. XXX X. +X+ XXX. .XXX 9 | XX XXXXXX .XXX XX XX XX XX +X .XX XX X XX +X .XXX X .X. XX.XXX. XXX. .XXX 10 | XX XX. . .XX XX XX..XX XX .X XX X XX XX . XX +. X X XX .XX XX XX 11 | XX .XXXXX XXXXX XXXXX .XXXX. XXXXXX XXXXX XXXX+ XX X +XXXX XXXXX+ X X X +XXXXX. XX XX 12 | XX .XXX+ +XXX. .XXX+ +XX+ XXXXXX XXXXX +XX+ XX ++ +XX+ .XXX. +. +X. +XXX+X XX XX 13 | X. XXXXXXX XX XXXX XXX 14 | +XXX XXXXXXX .XXX XX. 15 | -------------------------------------------------------------------------------- /src/fontrender_l.c: -------------------------------------------------------------------------------- 1 | /** 2 | * \file fontrender_l.c 3 | * 4 | * This file is distributed under the terms of the MIT License. 5 | * See the LICENSE file at the top of this tree, or if it is missing a copy can 6 | * be found at http://opensource.org/licenses/MIT 7 | */ 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #include "fontem.h" 15 | 16 | int font_draw_glyph_L(const struct font *font, 17 | int x, int y, int width, int height, 18 | uint8_t *buf, const struct glyph *glyph) 19 | { 20 | unsigned int rows = glyph->rows, cols = glyph->cols; 21 | const unsigned char *data = glyph->bitmap; 22 | unsigned char count = 0, class = 0; 23 | 24 | for (unsigned int row = 0; row < rows; row++) { 25 | int yofs = row + y + (font->ascender - glyph->top); 26 | 27 | for (unsigned int col = 0; col < cols; col++) { 28 | int xofs = col + x + glyph->left; 29 | 30 | uint8_t val; 31 | if (font->compressed) { 32 | if (count == 0) { 33 | count = (*data & 0x3f) + 1; 34 | class = *data >> 6; 35 | data++; 36 | } 37 | 38 | if (class == 0) 39 | val = *(data++); 40 | else if (class == 3) 41 | val = 0xff; 42 | else 43 | val = 0; 44 | count--; 45 | } else { 46 | val = data[(row * cols) + col]; 47 | } 48 | 49 | if ((yofs >= 0) && (yofs < height) && (xofs >= 0) && (xofs < width)) { 50 | uint8_t *pixel = buf + (yofs * width) + xofs; 51 | 52 | if (val < 64) *pixel = ' '; 53 | else if (val < 128) *pixel = '.'; 54 | else if (val < 192) *pixel = '+'; 55 | else *pixel = 'X'; 56 | } 57 | } 58 | } 59 | 60 | return glyph->advance; 61 | } 62 | 63 | int font_draw_char_L(const struct font *font, 64 | int x, int y, int width, int height, 65 | uint8_t *buf, glyph_t glyph, glyph_t prev) 66 | { 67 | if (font == NULL) return -1; 68 | const struct glyph *g = font_get_glyph(font, glyph); 69 | if (g == NULL) return -2; 70 | 71 | int kerning_offset = font_get_kerning(font, prev, glyph); 72 | 73 | return font_draw_glyph_L(font, x + kerning_offset, y, width, height, 74 | buf, g) + kerning_offset; 75 | } 76 | -------------------------------------------------------------------------------- /src/fontrender_rgba32.c: -------------------------------------------------------------------------------- 1 | /** 2 | * \file fontrender_rgba32.c 3 | * 4 | * This file is distributed under the terms of the MIT License. 5 | * See the LICENSE file at the top of this tree, or if it is missing a copy can 6 | * be found at http://opensource.org/licenses/MIT 7 | */ 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #include "fontem.h" 15 | 16 | int font_draw_glyph_RGBA32(const struct font *font, 17 | int x, int y, int width, int height, 18 | uint8_t *buf, const struct glyph *glyph, 19 | uint32_t rgb) 20 | { 21 | uint8_t r = rgba32_get_r(rgb); 22 | uint8_t g = rgba32_get_g(rgb); 23 | uint8_t b = rgba32_get_b(rgb); 24 | 25 | unsigned rows = glyph->rows, cols = glyph->cols; 26 | const unsigned char *data = glyph->bitmap; 27 | unsigned char count = 0, class = 0; 28 | 29 | for (unsigned row = 0; row < rows; row++) { 30 | int yofs = row + y + (font->ascender - glyph->top); 31 | 32 | for (unsigned col = 0; col < cols; col++) { 33 | int xofs = col + x + glyph->left; 34 | 35 | uint8_t val; 36 | if (font->compressed) { 37 | if (count == 0) { 38 | count = (*data & 0x3f) + 1; 39 | class = *(data++) >> 6; 40 | } 41 | 42 | if (class == 0) 43 | val = *(data++); 44 | else if (class == 3) 45 | val = 0xff; 46 | else 47 | val = 0; 48 | count--; 49 | } else { 50 | val = data[(row * cols) + col]; 51 | } 52 | 53 | if ((yofs >= 0) && (yofs < height) && (xofs >= 0) && (xofs < width)) { 54 | uint8_t *pixel = buf + (yofs * width * 3) + (xofs * 3); 55 | *pixel = blend(*pixel, r, val); 56 | pixel++; 57 | *pixel = blend(*pixel, g, val); 58 | pixel++; 59 | *pixel = blend(*pixel, b, val); 60 | } 61 | } 62 | } 63 | 64 | return glyph->advance; 65 | } 66 | 67 | int font_draw_char_RGBA32(const struct font *font, 68 | int x, int y, int width, int height, 69 | uint8_t *buf, glyph_t glyph, glyph_t prev, 70 | uint32_t rgb) 71 | { 72 | if (font == NULL) return -1; 73 | const struct glyph *g = font_get_glyph(font, glyph); 74 | if (g == NULL) return -2; 75 | 76 | int kerning_offset = font_get_kerning(font, prev, glyph); 77 | 78 | return font_draw_glyph_RGBA32(font, x + kerning_offset, y, width, height, 79 | buf, g, rgb) + kerning_offset; 80 | } 81 | -------------------------------------------------------------------------------- /tests/test-data/008a14c4e0ae783293f753c270f0ba89: -------------------------------------------------------------------------------- 1 | 2 | 3 | X .XX XX. 4 | XXXXXXXXX X .XXX. .X +XXX. +XXX+ XX .+XXX+ X +X+ X. +X+ XXX. X X. .X 5 | X X X X X. .X .XX XX ++ XX +X XX X+. +X. +XXX+ ++ ++ .X +X.X+ X. +X +. X .+ X X 6 | X X X .XXX. +XX+ XXXX+ +. .+ X X X X X X XX X. X ++ X +X X X X +X X+ X X .+X+. X X 7 | X .X +. X. .X X X X X X ++ XX .+ +XX.X .+ X X X X X ++ ++ ++ +X .+X+. X X 8 | X + X X X X X X .+ .XX+ XX X ++ +X X +X.X ++ ++.X +X+ ++X .XXX +. X .+ .X X. 9 | X XXXXXXX .XX. X X X X X ++ XX X X X X .XXX. +X+ X.++ ++ + +X X X XX XX 10 | X X +X. X X X X X X XX X X X .X X.X+ ++ X X X +X +. .+ X. 11 | X +. X X +. .+ X .X X X X ++ +X X. X X X X X X X. +X+ X X 12 | X X ++ X. .X X X X. .X X ++ X X+ ++ XX .+ +XX.XX. X+ X ++ X. ++ ++ +X .X+X X X 13 | XXX .XXX+ .XXX+ .XX. .XXX. XXXXX XXXXXXX .+XXX. XX X. +XXX+ .X +X+ .XXX. .XX. X X 14 | X+. .. X X X 15 | .XXXX. X .XX XX. 16 | XXXXXXX 17 | -------------------------------------------------------------------------------- /tests/test-data/212b1b5dcbe34c06a4a4cbc45b689f70: -------------------------------------------------------------------------------- 1 | 2 | 3 | X .XX XX. 4 | XXXXXXXXX X .XXX. .X +XXX. +XXX+ XX .+XXX+ X +X+ X. +X+ XXX. X X. .X 5 | X X X X X. .X .XX XX ++ XX +X XX X+. +X. +XXX+ ++ ++ .X +X.X+ X. +X +. X .+ X X 6 | X X X .XXX. +XX+ XXXX+ +. .+ X X X X X X XX X. X ++ X +X X X X +X X+ X X .+X+. X X 7 | X .X +. X. .X X X X X X ++ XX .+ +XX.X .+ X X X X X ++ ++ ++ +X .+X+. X X 8 | X + X X X X X X .+ .XX+ XX X ++ +X X +X.X ++ ++.X +X+ ++X .XXX +. X .+ .X X. 9 | X XXXXXXX .XX. X X X X X ++ XX X X X X .XXX. +X+ X.++ ++ + +X X X XX XX 10 | X X +X. X X X X X X XX X X X .X X.X+ ++ X X X +X +. .+ X. 11 | X +. X X +. .+ X .X X X X ++ +X X. X X X X X X X. +X+ X X 12 | X X ++ X. .X X X X. .X X ++ X X+ ++ XX .+ +XX.XX. X+ X ++ X. ++ ++ +X .X+X X X 13 | XXX .XXX+ .XXX+ .XX. .XXX. XXXXX XXXXXXX .+XXX. XX X. +XXX+ .X +X+ .XXX. .XX. X X 14 | X+. .. X X X 15 | .XXXX. X .XX XX. 16 | XXXXXXX 17 | -------------------------------------------------------------------------------- /src/fontrender_rgb16.c: -------------------------------------------------------------------------------- 1 | /** 2 | * \file fontrender_rgb16.c 3 | * 4 | * This file is distributed under the terms of the MIT License. 5 | * See the LICENSE file at the top of this tree, or if it is missing a copy can 6 | * be found at http://opensource.org/licenses/MIT 7 | */ 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #include "fontem.h" 15 | 16 | int font_draw_glyph_RGB16(const struct font *font, 17 | int x, int y, int width, int height, 18 | uint8_t *buf, const struct glyph *glyph, 19 | uint16_t rgb) 20 | { 21 | unsigned int rows = glyph->rows, cols = glyph->cols; 22 | const unsigned char *data = glyph->bitmap; 23 | unsigned char count = 0, class = 0; 24 | 25 | for (unsigned int row = 0; row < rows; row++) { 26 | int yofs = row + y + (font->ascender - glyph->top); 27 | 28 | for (unsigned int col = 0; col < cols; col++) { 29 | int xofs = col + x + glyph->left; 30 | 31 | uint8_t val; 32 | if (font->compressed) { 33 | if (count == 0) { 34 | count = (*data & 0x3f) + 1; 35 | class = *(data++) >> 6; 36 | } 37 | 38 | if (class == 0) 39 | val = *(data++); 40 | else if (class == 3) 41 | val = 0xff; 42 | else 43 | val = 0; 44 | count--; 45 | } else { 46 | val = data[(row * glyph->cols) + col]; 47 | } 48 | 49 | if ((yofs >= 0) && (yofs < height) && (xofs >= 0) && (xofs < width)) { 50 | uint16_t *pixel = (uint16_t *)(buf + (yofs * width * 2) + (xofs * 2)); 51 | 52 | uint16_t r = alpha_blend(rgb16_get_r(*pixel), 0, rgb16_get_r(rgb), val); 53 | uint16_t g = alpha_blend(rgb16_get_g(*pixel), 0, rgb16_get_g(rgb), val); 54 | uint16_t b = alpha_blend(rgb16_get_b(*pixel), 0, rgb16_get_b(rgb), val); 55 | 56 | *pixel = rgb16_combine(r, g, b); 57 | } 58 | } 59 | } 60 | 61 | return glyph->advance; 62 | } 63 | 64 | int font_draw_char_RGB16(const struct font *font, 65 | int x, int y, int width, int height, 66 | uint8_t *buf, glyph_t glyph, glyph_t prev, 67 | uint16_t rgb) 68 | { 69 | if (font == NULL) return -1; 70 | const struct glyph *g = font_get_glyph(font, glyph); 71 | if (g == NULL) return -2; 72 | 73 | int kerning_offset = font_get_kerning(font, prev, glyph); 74 | 75 | return font_draw_glyph_RGB16(font, x + kerning_offset, y, width, height, 76 | buf, g, rgb) + kerning_offset; 77 | } 78 | 79 | char *font_draw_string_RGB16(const struct font *font, 80 | int x, int y, int width, int height, 81 | uint8_t *buf, char *str, char prev, 82 | uint16_t rgb) 83 | { 84 | if (font == NULL) return NULL; 85 | 86 | while (*str) { 87 | const struct glyph *g = font_get_glyph(font, *str); 88 | if (g == NULL) continue; 89 | 90 | int kerning_offset = font_get_kerning(font, prev, *str); 91 | 92 | if (g->advance + kerning_offset > width) 93 | break; // todo - linewrap? 94 | 95 | x += font_draw_glyph_RGB16(font, x + kerning_offset, y, width, height, 96 | buf, g, rgb) + kerning_offset; 97 | 98 | str++; 99 | } 100 | 101 | return str; 102 | } 103 | -------------------------------------------------------------------------------- /src/Makefile.am: -------------------------------------------------------------------------------- 1 | # src Makefile.am 2 | # 3 | # This file is distributed under the terms of the MIT License. 4 | # See the LICENSE file at the top of this tree, or if it is missing a copy can 5 | # be found at http://opensource.org/licenses/MIT 6 | 7 | lib_LTLIBRARIES = libfontem.la libfonts.la 8 | bin_PROGRAMS = fontem fonttest 9 | include_HEADERS = resource/fontem.h 10 | 11 | fontem_sources = \ 12 | fontem.c 13 | 14 | libfontem_sources = \ 15 | fontrender.c \ 16 | fontrender_l.c \ 17 | fontrender_rgba32.c \ 18 | fontrender_rgb16.c \ 19 | fontfinder.c 20 | 21 | fonttest_sources = \ 22 | fonttest.c 23 | 24 | fontem_SOURCES = $(fontem_sources) 25 | 26 | libfontem_la_SOURCES = $(libfontem_sources) 27 | libfontem_la_CPPFLAGS = -Iresource -Ifonts $(AM_CPPFLAGS) 28 | 29 | fonttest_LDADD = libfontem.la libfonts.la 30 | fonttest_SOURCES = $(fonttest_sources) 31 | fonttest_CPPFLAGS = -Iresource $(AM_CPPFLAGS) 32 | fonttest.c: $(fontout)/font_all.h 33 | 34 | fontdir := $(top_srcdir)/fonts 35 | fontout := fonts 36 | 37 | fonts_raw_sources := \ 38 | fonts/font-UbuntuMonoR-10.c \ 39 | fonts/font-UbuntuMonoR-16.c \ 40 | fonts/font-UbuntuMonoB-10.c \ 41 | fonts/font-UbuntuMonoB-16.c \ 42 | fonts/font-DejaVuSerif-10.c \ 43 | fonts/font-DejaVuSerif-16.c 44 | 45 | fonts_rle_sources := \ 46 | fonts/font-UbuntuMonoR-10-rle.c \ 47 | fonts/font-UbuntuMonoR-16-rle.c \ 48 | fonts/font-UbuntuMonoB-10-rle.c \ 49 | fonts/font-UbuntuMonoB-16-rle.c \ 50 | fonts/font-DejaVuSerif-10-rle.c \ 51 | fonts/font-DejaVuSerif-16-rle.c 52 | 53 | fonts_all_sources := $(fonts_raw_sources) $(fonts_rle_sources) 54 | 55 | BUILT_SOURCES = $(fonts_all_sources) fonts/font_all.c 56 | libfonts_la_SOURCES = $(fonts_all_sources) fonts/font_all.c 57 | libfonts_la_CPPFLAGS = -Iresource $(AM_CPPFLAGS) 58 | 59 | .SECONDEXPANSION: 60 | $(fonts_raw_sources): %.c: $$(fontdir)/$$(word 2,$$(subst -, ,%)).ttf resource/fontem.h fontem 61 | @mkdir -p $(fontout) 62 | ./fontem --font=$(fontdir)/$(word 2,$(subst -, ,$(notdir $@))).ttf \ 63 | --dir=$(fontout) --name=$(word 2,$(subst -, ,$(notdir $@))) \ 64 | --size=$(word 3,$(subst -, ,$(subst .c,,$(notdir $@)))) 65 | 66 | $(fonts_rle_sources): %.c: $$(fontdir)/$$(word 2,$$(subst -, ,%)).ttf resource/fontem.h fontem 67 | @mkdir -p $(fontout) 68 | ./fontem --font=$(fontdir)/$(word 2,$(subst -, ,$(notdir $@))).ttf \ 69 | --dir=$(fontout) --name=$(word 2,$(subst -, ,$(notdir $@))) \ 70 | --size=$(word 3,$(subst -, ,$(subst .c,,$(notdir $@)))) \ 71 | --rle --append=-rle 72 | 73 | $(fontout)/font_all.h: $(fonts_all_sources) Makefile 74 | @echo "/* A list of all font headers. */" > $@ 75 | @echo >> $@ 76 | @echo "#include \"fontem.h\"" >> $@ 77 | @echo >> $@ 78 | for font in $(sort $(notdir $(fonts_all_sources:%.c=%.h))); do echo "#include \"$$font\"" >> $@; done 79 | @echo >> $@ 80 | @echo "extern const struct font *fonts[];" >> $@ 81 | @echo "extern const int font_count;" >> $@ 82 | 83 | $(fontout)/font_all.c: $(fontout)/font_all.h Makefile 84 | @echo "/* A list of all fonts. */" > $@ 85 | @echo >> $@ 86 | @echo "#include " > $@ 87 | @echo "#include \"fontem.h\"" >> $@ 88 | @echo "#include \"font_all.h\"" >> $@ 89 | @echo >> $@ 90 | @echo "const int font_count = $(words $(fonts_all_sources));" >> $@ 91 | @echo >> $@ 92 | @echo "const struct font *fonts[] = {" >> $@ 93 | for font in $(sort $(subst -,_,$(notdir $(fonts_all_sources:%.c=%)))); do printf "\t&$$font,\n" >> $@; done 94 | @printf "\tNULL\n" >> $@ 95 | @echo "};" >> $@ 96 | 97 | 98 | clean-local: 99 | rm -f $(fonts_all_sources) $(fonts_all_sources:.c=.h) $(fontout)/font_all.h $(fontout)/font_all.c 100 | 101 | distclean-local: 102 | rm -f Makefile.in 103 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | C Font Embedder 2 | =============== 3 | 4 | [![Build Status](https://travis-ci.org/chrisy/fontem.svg?branch=master)](https://travis-ci.org/chrisy/fontem) [![Language grade: C/C++](https://img.shields.io/lgtm/grade/cpp/g/chrisy/fontem.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/chrisy/fontem/context:cpp) 5 | 6 | Overview 7 | -------- 8 | 9 | A simple C program to turn selected characters from a TrueType font file into 10 | a .c/.h file pair such that the type can be embedded into the binary of a 11 | program. This is particularly useful for Embedded systems that may not have a 12 | file storage device. 13 | 14 | 15 | Command line parameters 16 | ----------------------- 17 | 18 | ``` 19 | Usage: fontem [OPTION...] 20 | -f, --font=file Font filename (default: null) 21 | -s, --size=integer Font size (default: 10) 22 | -c, --chars=string List of characters to produce (default: "!@#$%^&*()_+-={}|[]\:";'<>?,./`~ 23 | ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789ÄÖÜßäöü") 24 | -n, --name=file Output name (without extension) (default: null) 25 | -d, --dir=dir Output directory (default: ".") 26 | --section=name Section for font data 27 | --rle=rle Use RLE compression (default: 0) 28 | --append Append str to filename, structs (default: "") 29 | 30 | Help options: 31 | -?, --help Show this help message 32 | --usage Display brief usage message 33 | ``` 34 | 35 | 36 | Example usage 37 | ------------- 38 | 39 | ```bash 40 | mkdir -p fonts 41 | 42 | ./fontem --font=/usr/share/fonts/truetype/ubuntu-font-family/UbuntuMono-B.ttf \ 43 | --size=10 --name=ubuntumono --dir=fonts 44 | ``` 45 | 46 | This will generate two files, `fonts/font-ubuntumono-10.c` and 47 | `fonts/font-ubuntumono-10.h`. 48 | 49 | To use them, you will need to copy `src/resource/fontem.h` to the `fonts` 50 | directory. Examples of these files may be found in the `examples` directory of 51 | this repository. 52 | 53 | The `.c` file contains descriptions of each character (glyph) that was 54 | translated. At the end there is a lookup table mapping the glyphs to their 55 | ASCII code. (Note that this table is indexed on the ordinal value of each 56 | character; if you include high-valued UNICODE characters then this will make 57 | for a large empty table; this shortcoming will be addressed in a future 58 | revision.) 59 | 60 | 61 | Dependencies 62 | ------------ 63 | 64 | Along side GCC and GNU Autotools, this project depends on the `libpopt` and 65 | `libfreetype` libraries. 66 | 67 | On Ubuntu the build dependencies can be installed with: 68 | 69 | ```bash 70 | sudo apt install build-essential automake autoconf libtool \ 71 | libpopt-dev libfreetype6-dev 72 | ``` 73 | 74 | And the runtime dependencies, if you need to move the program to another host, 75 | can be installed with: 76 | 77 | ```bash 78 | sudo apt install libpopt0 libfreetype6 79 | ``` 80 | 81 | 82 | Locale 83 | ------ 84 | 85 | Fontem does not make use of any localization mechanism to translate diagnostic 86 | messages, but it does require a working locale to properly interpret wide 87 | characters; note that several characters that fall outside of ASCII-7 exist in 88 | the default character set that fontem will generate fonts for. 89 | 90 | Some stripped-down systems (such as container images) may need a `locales` 91 | package and/or an appropriate `language` package. For English on Ubuntu this 92 | would require the package `language-pack-en`. On such systems it is likely the 93 | system locale has not been set, so use of the `LC_ALL` environment variable 94 | may be required, or configuring the system locale. The page 95 | https://help.ubuntu.com/community/Locale may provide guidance. 96 | 97 | 98 | License 99 | ------- 100 | 101 | This file is distributed under the terms of the MIT License. See the LICENSE 102 | file at the top of this tree, or if it is missing a copy can be found at 103 | http://opensource.org/licenses/MIT 104 | -------------------------------------------------------------------------------- /configure.ac: -------------------------------------------------------------------------------- 1 | dnl Process this file with autoconf to produce a configure script. 2 | # vim:set softtabstop=4 shiftwidth=4 tabstop=4 expandtab: 3 | # 4 | # This file is distributed under the terms of the MIT License. 5 | # See the LICENSE file at the top of this tree, or if it is missing a copy can 6 | # be found at http://opensource.org/licenses/MIT 7 | # 8 | 9 | AC_PREREQ(2.67) 10 | AC_COPYRIGHT([(c) 2014 Chris Luke]) 11 | 12 | AC_INIT([fontem], [0.1]) 13 | AC_CONFIG_AUX_DIR([build-aux]) 14 | AC_CONFIG_MACRO_DIR([aclocal]) 15 | AC_CANONICAL_TARGET 16 | 17 | AM_INIT_AUTOMAKE([subdir-objects foreign]) 18 | 19 | # Build programs 20 | AC_PROG_MAKE_SET 21 | AC_PROG_LN_S 22 | AC_PROG_AWK 23 | AC_PROG_CC 24 | AC_PROG_CPP 25 | AC_PROG_CXX 26 | AC_PROG_CC_C99 27 | AM_PROG_CC_C_O 28 | LT_INIT 29 | AC_DISABLE_FAST_INSTALL 30 | AC_PROG_LIBTOOL 31 | AC_ENABLE_SHARED 32 | AC_SUBST([LIBTOOL_DEPS]) 33 | 34 | if test x"$ac_cv_prog_cc_c99" = xno; then 35 | AC_MSG_ERROR([We need C99 and cannot figure out how to enable it]) 36 | fi 37 | 38 | # Compiler flags 39 | AX_CFLAGS_GCC_OPTION([-pipe]) 40 | 41 | # Libraries 42 | if test -d /usr/local/lib; then 43 | LDFLAGS="$LDFLAGS -L/opt/local/lib" 44 | fi 45 | if test -d /opt/local/lib; then 46 | LDFLAGS="$LDFLAGS -L/opt/local/lib" 47 | fi 48 | 49 | AC_CHECK_LIB([popt], [poptGetContext], [], [AC_MSG_FAILURE([could not find libpopt])]) 50 | AC_CHECK_LIB([freetype], [FT_Init_FreeType], [], [AC_MSG_FAILURE([cannot find FT_Init_FreeType in libfreetype])]) 51 | 52 | # Library functions 53 | AC_CHECK_FUNCS([memcpy strdup strndup]) 54 | 55 | # Compiler flags part deux 56 | AX_CFLAGS_GCC_OPTION([-Wall]) 57 | AX_CFLAGS_GCC_OPTION([-W]) 58 | AX_CFLAGS_GCC_OPTION([-Wextra]) 59 | 60 | # These are warnings included in -Wextra, but we don't want all of -Wextra 61 | AX_CFLAGS_GCC_OPTION([-Wno-unused-parameter]) 62 | 63 | # And finally, be picky 64 | AX_CFLAGS_GCC_OPTION([-Werror]) 65 | AX_CFLAGS_GCC_OPTION([-pedantic]) 66 | 67 | # Debug mode 68 | AC_ARG_ENABLE([debug], 69 | [AS_HELP_STRING([--enable-debug], [configure with debugging features enabled]) ] 70 | ) 71 | if test x"$enable_debug" = xyes; then 72 | CPPFLAGS="$CPPFLAGS -D_DEBUG" 73 | ggdb= 74 | if test x`uname` = xLinux; then 75 | ggdb=gdb 76 | fi 77 | CFLAGS="$CFLAGS -O0 -g$ggdb" 78 | else 79 | CFLAGS="$CFLAGS -O2 -g" 80 | fi 81 | 82 | # Add our various discovered flags 83 | CPPFLAGS="$CPPFLAGS $LIBCURL_CPPFLAGS" 84 | CFLAGS="$CFLAGS $PTHREAD_CFLAGS" 85 | LIBS="$LIBS $LIBCURL $PTHREAD_LIBS" 86 | 87 | # Headers 88 | AC_CHECK_HEADERS([sys/types.h stdlib.h math.h string.h \ 89 | fcntl.h sys/stat.h stdint.h]) 90 | 91 | # Definitions (typedef, struct etc) 92 | AC_C_INLINE 93 | case "$ac_cv_c_inline" in 94 | yes) cc_inline=inline;; 95 | no) cc_inline=;; 96 | *) cc_inline="$ac_cv_c_inline";; 97 | esac 98 | AC_SUBST([cc_inline]) 99 | 100 | # Setup our include search paths 101 | bdir="${srcdir}" 102 | if test x"${bdir}" = x'.' ; then 103 | bdir=$(pwd) 104 | fi 105 | 106 | if test -d /usr/local/include; then 107 | CPPFLAGS="$CPPFLAGS -I/usr/local/include" 108 | fi 109 | if test -d /opt/local/include; then 110 | CPPFLAGS="$CPPFLAGS -I/opt/local/include" 111 | fi 112 | if test -d /usr/include/freetype2; then 113 | CPPFLAGS="$CPPFLAGS -I/usr/include/freetype2" 114 | fi 115 | if test -d /usr/local/include/freetype2; then 116 | CPPFLAGS="$CPPFLAGS -I/usr/local/include/freetype2" 117 | fi 118 | if test -d /opt/local/include/freetype2; then 119 | CPPFLAGS="$CPPFLAGS -I/opt/local/include/freetype2" 120 | fi 121 | 122 | # Display the summary 123 | CC=`echo $CC | sed -e 's/ / /g'` 124 | CPPFLAGS=`echo $CPPFLAGS | sed -e 's/ / /g'` 125 | CFLAGS=`echo $CFLAGS | sed -e 's/ / /g'` 126 | LD=`echo $LD | sed -e 's/ / /g'` 127 | LDFLAGS=`echo $LDFLAGS | sed -e 's/ / /g'` 128 | LIBS=`echo $LIBS | sed -e 's/ / /g'` 129 | 130 | echo "CC: $CC" >&2 131 | echo "CPPFLAGS: $CPPFLAGS" >&2 132 | echo "CFLAGS: $CFLAGS" >&2 133 | echo "LD: $LD" >&2 134 | echo "LDFLAGS: $LDFLAGS" >&2 135 | echo "LIBS: $LIBS" >&2 136 | 137 | # Output 138 | AC_CONFIG_HEADER([include/ac_config.h]) 139 | AC_CONFIG_FILES([Makefile 140 | include/Makefile 141 | include/cc_config.h 142 | src/Makefile 143 | tests/Makefile]) 144 | AC_OUTPUT 145 | 146 | -------------------------------------------------------------------------------- /tests/test-data/48f550d629c2ea64b042641b2cd110a0: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | XXX +XXXX XXXXX. 5 | XXXXXXXXXXX .XXX. +XX .XXX+ +XXX+ XXX +XXX+ XXX +X+ .X+ XXX .XXX. XXX +XXXXX XXXXXX+ 6 | XXXXXXXXXXX XXX +XXXXX+ XXXX +XXXXXX XXXXXXX XXX XXXXXXX .XXXXXX+ +XXX+ XX +XXX+ .XXXXX+ .+ XXX +. XXX. .XXX 7 | XXX XXX XX. .XX +XXXXX .X. +XX+ .+ +XX+ XXX +XX. +X+ .XXXXXXX+ XXXXX .X+ .XX.XX. XX. .XX +XX+X+XX+ XXX XXX 8 | XXX XXX +X+ +X+ XXXXXXX XXX XXX XXX XX XX XXX. .. XX XX XX XX+ +XX XX XX XXXXXXXXX XXX XXX 9 | XXX .XXX+ .+XXXXX+ XXXXXXXXX XX XX .XX XXX XXX XXX XXX +X+ .XXXXX XXX XX XX+X. +XX XXX XX+ XX+ +X+ XXX XXX 10 | XXX +XXXXXX .XXXXXXXX XXXXXXXXX XX .X+ XX XXX +XX+ +XX+ XXX +X..XXXXXX XXX+ +XXXXXX .XX+ +XX. .XXXXX XX+XX XXX XXX 11 | XXX .XX+ +XX+ XXX. .. XXX XX XXX XX XXX +XXX XXXXX XXX XX +X+ XX .XXXX+ +X+XX. .X X+ XXX+ X+ +XX XX+ XXX XXX 12 | XXX XXX XXX XXX+ XXX XX .X+ XX XXX .XXX. XXXXX. XXX XX XX XX .XXXXX+ .X+ +X+ XXXXX. XX +. .+ .XX+ +XX. 13 | XXX XXXXXXXXX .XXXXX+ XXX XX XX XXX XXX+ XXX. +X+ XX XX XX .XXXX. XX +XXX+ +XX XXX+XX XXX+ +XXX 14 | XXX XXXXXXXXX +XXXXX. XXX XX XX XXX XXX+ XXX XX XX XX +XXX .X+ XX.XX XX XXXX. XXX+ +XXX 15 | XXX XXX +XXX XXX +X+ +X+ XXX .XX+ XXX XX +X+ XX XXX XX XX XX XX .XXX .XX+ +XX. 16 | XXX +XX+ .+ .. XXX XXX. . XX. .XX XXX XXX .. +XX+ +X+ +X. XXXXXX .+ .XXX +X. XX.XX +X+ .XXX. XXX XXX 17 | XXX XXXXXXX XXXXXXXX+ +XXXXXX +XXXXX+ XXXXXXXXX XXXXXXXXX XXXXXXXX XXX .X+ +XXXX XXXXXXXX XX +XXX+ XXXXXXXXX XXX XXX 18 | XXX .XXXX+ .+XXXX+. +XXXX+ .XXX. XXXXXXXXX XXXXXXXXX .+XXXX+ +X+ XX. .+XXXX+ +X. +X+ +XXX+..X. XXX XXX 19 | .XX+ XXX XXX XXX 20 | +XXXXXXX XXX XXX. .XXX 21 | +XXXXX XXXXXXXXXXX +XXXXX XXXXXX+ 22 | XXXXXXXXXXX +XXXX XXXXX+ 23 | -------------------------------------------------------------------------------- /tests/test-data/7fa82c5af0b3a82c6802298fa0b0cd5b: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | XX +XXXX XXXX+ 5 | XXXXXXXXXX .XXX. XX +XXX. +XXX+. XX +XX+ XX XX .+ +X+ +XX+ XX +X+ +X+ 6 | XXXXXXXXXX XX +XXXXX+ .XXX XXXXXX. XXXXXXX. XX XXXXXX +XXXX. +..+ X XXX +XXXX+ XX XX XX 7 | XX XX XX. .XX +XXXX +. +XX .+ +XX XX XX+ XX+ XXXXXXX X X +. XX.XX XX. XX ++ ++ ++ XX XX 8 | XX XX +X+ +X+ ++. XX XX XX XX XX XX XX+ .+ X X + .X. .X. XX XX XXXXXXXX XX XX 9 | XX .XXX+ .XXXXX+ XXXXXXXXX XX XX XX XX XX XX +X. XX XX X X X X+ +X +X..X. ..XX+. XX XX 10 | XX +XXXXXX +XXXXXXX XXXXXXXXX XX +X+ XX XX .X. .XX. XX +X .XXXX XX+ +..+ +. +X X+ XXX+ +XX+ XX XX 11 | XX .XX. +X+ XX. .+ XX XX XXX XX XX XX XXXX. XX XX .XXXXX .XXXX. XX X +. .+ .XXX XX +X..X+ XX XX 12 | XX XX XX XX+. XX XX +X+ XX XX +X XXXXX. XX XX XX. XX .XXXXX. X XX XX.XX XX .+ +. .X. .X. 13 | XX XXXXXXXXX .XXXX+ XX XX XX XX +X. .XX. ++ XX XX XX +XXX. .+ +..+ +X. .XXX+ XX+ +XX 14 | XX XX +XXXX. XX XX. .XX XX .X. XX XX XX XX +XX X X X XX +XX. +X. .X. 15 | XX XX. +XX XX +X+ +X+ XX X+ XX XX XX. XX XX + X X XX XX. XX XX 16 | XX .XX. +. .XX XX+ XX. .XX XX +X +. XX+ +X+ +X..XXXXX ++ +XX .+ X X XXX +XXX XX XX 17 | XX +XXXXXX XXXXXXX+ +XXXXXX +XXXXX+ XXXXXXXX XXXXXXXX XXXXXXXX XXX .XX .XXX+ XXXXXXXX. X +..+ .XXXXX++X. XX XX 18 | XX .XXXX+ .+XXXX. +XXXX+ .XXX. XXXXXXXX XXXXXXXX .+XXXX+ +X+ XX. +XXXXX. +. XX .XXX. XX XX XX 19 | .XX. XX XX XX 20 | +XXXXX XX XX XX 21 | .XXX+ XXXXXXXXXXX +X+ +X+ 22 | XXXXXXXXXXX +XXXX XXXX+ 23 | -------------------------------------------------------------------------------- /tests/test-data/a29399fb27450e3ccf6783d227ea4553: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | XX +XXXX XXXX+ 5 | XXXXXXXXXX .XXX. XX +XXX. +XXX+. XX +XX+ XX XX .+ +X+ +XX+ XX +X+ +X+ 6 | XXXXXXXXXX XX +XXXXX+ .XXX XXXXXX. XXXXXXX. XX XXXXXX +XXXX. +..+ X XXX +XXXX+ XX XX XX 7 | XX XX XX. .XX +XXXX +. +XX .+ +XX XX XX+ XX+ XXXXXXX X X +. XX.XX XX. XX ++ ++ ++ XX XX 8 | XX XX +X+ +X+ ++. XX XX XX XX XX XX XX+ .+ X X + .X. .X. XX XX XXXXXXXX XX XX 9 | XX .XXX+ .XXXXX+ XXXXXXXXX XX XX XX XX XX XX +X. XX XX X X X X+ +X +X..X. ..XX+. XX XX 10 | XX +XXXXXX +XXXXXXX XXXXXXXXX XX +X+ XX XX .X. .XX. XX +X .XXXX XX+ +..+ +. +X X+ XXX+ +XX+ XX XX 11 | XX .XX. +X+ XX. .+ XX XX XXX XX XX XX XXXX. XX XX .XXXXX .XXXX. XX X +. .+ .XXX XX +X..X+ XX XX 12 | XX XX XX XX+. XX XX +X+ XX XX +X XXXXX. XX XX XX. XX .XXXXX. X XX XX.XX XX .+ +. .X. .X. 13 | XX XXXXXXXXX .XXXX+ XX XX XX XX +X. .XX. ++ XX XX XX +XXX. .+ +..+ +X. .XXX+ XX+ +XX 14 | XX XX +XXXX. XX XX. .XX XX .X. XX XX XX XX +XX X X X XX +XX. +X. .X. 15 | XX XX. +XX XX +X+ +X+ XX X+ XX XX XX. XX XX + X X XX XX. XX XX 16 | XX .XX. +. .XX XX+ XX. .XX XX +X +. XX+ +X+ +X..XXXXX ++ +XX .+ X X XXX +XXX XX XX 17 | XX +XXXXXX XXXXXXX+ +XXXXXX +XXXXX+ XXXXXXXX XXXXXXXX XXXXXXXX XXX .XX .XXX+ XXXXXXXX. X +..+ .XXXXX++X. XX XX 18 | XX .XXXX+ .+XXXX. +XXXX+ .XXX. XXXXXXXX XXXXXXXX .+XXXX+ +X+ XX. +XXXXX. +. XX .XXX. XX XX XX 19 | .XX. XX XX XX 20 | +XXXXX XX XX XX 21 | .XXX+ XXXXXXXXXXX +X+ +X+ 22 | XXXXXXXXXXX +XXXX XXXX+ 23 | -------------------------------------------------------------------------------- /tests/test-data/c42f4ba573999d6fe920e7c86f5198cf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | XXX +XXXX XXXXX. 5 | XXXXXXXXXXX .XXX. +XX .XXX+ +XXX+ XXX +XXX+ XXX +X+ .X+ XXX .XXX. XXX +XXXXX XXXXXX+ 6 | XXXXXXXXXXX XXX +XXXXX+ XXXX +XXXXXX XXXXXXX XXX XXXXXXX .XXXXXX+ +XXX+ XX +XXX+ .XXXXX+ .+ XXX +. XXX. .XXX 7 | XXX XXX XX. .XX +XXXXX .X. +XX+ .+ +XX+ XXX +XX. +X+ .XXXXXXX+ XXXXX .X+ .XX.XX. XX. .XX +XX+X+XX+ XXX XXX 8 | XXX XXX +X+ +X+ XXXXXXX XXX XXX XXX XX XX XXX. .. XX XX XX XX+ +XX XX XX XXXXXXXXX XXX XXX 9 | XXX .XXX+ .+XXXXX+ XXXXXXXXX XX XX .XX XXX XXX XXX XXX +X+ .XXXXX XXX XX XX+X. +XX XXX XX+ XX+ +X+ XXX XXX 10 | XXX +XXXXXX .XXXXXXXX XXXXXXXXX XX .X+ XX XXX +XX+ +XX+ XXX +X..XXXXXX XXX+ +XXXXXX .XX+ +XX. .XXXXX XX+XX XXX XXX 11 | XXX .XX+ +XX+ XXX. .. XXX XX XXX XX XXX +XXX XXXXX XXX XX +X+ XX .XXXX+ +X+XX. .X X+ XXX+ X+ +XX XX+ XXX XXX 12 | XXX XXX XXX XXX+ XXX XX .X+ XX XXX .XXX. XXXXX. XXX XX XX XX .XXXXX+ .X+ +X+ XXXXX. XX +. .+ .XX+ +XX. 13 | XXX XXXXXXXXX .XXXXX+ XXX XX XX XXX XXX+ XXX. +X+ XX XX XX .XXXX. XX +XXX+ +XX XXX+XX XXX+ +XXX 14 | XXX XXXXXXXXX +XXXXX. XXX XX XX XXX XXX+ XXX XX XX XX +XXX .X+ XX.XX XX XXXX. XXX+ +XXX 15 | XXX XXX +XXX XXX +X+ +X+ XXX .XX+ XXX XX +X+ XX XXX XX XX XX XX .XXX .XX+ +XX. 16 | XXX +XX+ .+ .. XXX XXX. . XX. .XX XXX XXX .. +XX+ +X+ +X. XXXXXX .+ .XXX +X. XX.XX +X+ .XXX. XXX XXX 17 | XXX XXXXXXX XXXXXXXX+ +XXXXXX +XXXXX+ XXXXXXXXX XXXXXXXXX XXXXXXXX XXX .X+ +XXXX XXXXXXXX XX +XXX+ XXXXXXXXX XXX XXX 18 | XXX .XXXX+ .+XXXX+. +XXXX+ .XXX. XXXXXXXXX XXXXXXXXX .+XXXX+ +X+ XX. .+XXXX+ +X. +X+ +XXX+..X. XXX XXX 19 | .XX+ XXX XXX XXX 20 | +XXXXXXX XXX XXX. .XXX 21 | +XXXXX XXXXXXXXXXX +XXXXX XXXXXX+ 22 | XXXXXXXXXXX +XXXX XXXXX+ 23 | -------------------------------------------------------------------------------- /src/fonttest.c: -------------------------------------------------------------------------------- 1 | /** 2 | * \file src/fonttest.c 3 | * 4 | * This file is distributed under the terms of the MIT License. 5 | * See the LICENSE file at the top of this tree, or if it is missing a copy can 6 | * be found at http://opensource.org/licenses/MIT 7 | */ 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #include 15 | 16 | #include "resource/fontem.h" 17 | #include "fonts/font_all.h" 18 | 19 | #ifndef EOL 20 | #define EOL "\n" 21 | #endif 22 | 23 | static void fia_print_table(struct font *font, void *opaque) 24 | { 25 | FILE *out = (FILE *)opaque; 26 | 27 | fprintf(out, "%-20s %-8s %-6d %-6d %-6d %-3c" EOL, 28 | font->name, 29 | font->style, 30 | font->size, 31 | font->height, 32 | font->ascender + font->descender, 33 | font->compressed ? 'Y' : ' '); 34 | } 35 | 36 | /** Dumps a table of all the fonts we know about. */ 37 | static void font_print_all(FILE *out) 38 | { 39 | fprintf(out, "%-20s %-8s %-6s %-6s %-6s %-3s" EOL, 40 | "Font name", "Style", "Size", 41 | "Vdist", "Height", "RLE"); 42 | font_iterate_all(fia_print_table, (void *)out); 43 | } 44 | 45 | static void fia_print_args(struct font *font, void *opaque) 46 | { 47 | FILE *out = (FILE *)opaque; 48 | 49 | fprintf(out, "--fontname=\"%s\" --fontstyle=\"%s\" " \ 50 | "--fontsize=%d --fontrle=%d\n", 51 | font->name, 52 | font->style, 53 | font->size, 54 | font->compressed); 55 | } 56 | 57 | /** Dumps the fonttable as a set of args that can be used 58 | * with fonttest to invoke that font. */ 59 | static void font_print_args(FILE *out) 60 | { 61 | font_iterate_all(fia_print_args, (void *)out); 62 | } 63 | 64 | int main(int argc, const char *argv[]) 65 | { 66 | char *string = "Test"; 67 | char *font_name = "DejaVu Serif"; 68 | char *font_style = NULL; 69 | int font_size = 10; 70 | int font_rle = -1; 71 | int width = -1; 72 | int height = -1; 73 | 74 | struct poptOption opts[] = { 75 | { "text", 't', POPT_ARG_STRING | POPT_ARGFLAG_SHOW_DEFAULT, &string, 1, "String to render", "text" }, 76 | { "fontname", 'f', POPT_ARG_STRING | POPT_ARGFLAG_SHOW_DEFAULT, &font_name, 1, "Name of the font to use", "font" }, 77 | { "fontstyle", 'S', POPT_ARG_STRING | POPT_ARGFLAG_SHOW_DEFAULT, &font_style, 1, "Style of the font to use", "style" }, 78 | { "fontsize", 's', POPT_ARG_INT | POPT_ARGFLAG_SHOW_DEFAULT, &font_size, 1, "Size of the fonr to use", "pts" }, 79 | { "fontrle", 'r', POPT_ARG_INT | POPT_ARGFLAG_SHOW_DEFAULT, &font_rle, 1, "0 = no RLE, 1 = RLE only, -1 = any", "mode" }, 80 | { "width", 'w', POPT_ARG_INT | POPT_ARGFLAG_SHOW_DEFAULT, &width, 1, "Canvas width", "chars" }, 81 | { "height", 'h', POPT_ARG_INT | POPT_ARGFLAG_SHOW_DEFAULT, &height, 1, "Canvas height", "chars" }, 82 | { "list", 'l', 0, NULL, 2, "List available fonts", NULL }, 83 | { "list-args", 'a', 0, NULL, 3, "List available fonts as shell args", NULL }, 84 | POPT_AUTOHELP 85 | POPT_TABLEEND 86 | }; 87 | 88 | poptContext ctx = poptGetContext(NULL, argc, argv, opts, 0); 89 | int rc; 90 | 91 | while ((rc = poptGetNextOpt(ctx)) > 0) { 92 | switch (rc) { 93 | case 2: 94 | font_print_all(stdout); 95 | return 0; 96 | case 3: 97 | font_print_args(stdout); 98 | return 0; 99 | } 100 | } 101 | 102 | poptFreeContext(ctx); 103 | 104 | if (string == NULL) { 105 | fprintf(stderr, "ERROR: You must specify a string to render.\n"); 106 | return 1; 107 | } 108 | 109 | if (font_name == NULL) { 110 | fprintf(stderr, "ERROR: You must specify a font name to render.\n"); 111 | return 1; 112 | } 113 | 114 | const struct font *font = font_find_all(font_name, font_style, font_size, (char)font_rle); 115 | 116 | if (font == NULL) { 117 | fprintf(stderr, "ERROR: Unable to find a font matching \"%s\" size \"%d\".\n", 118 | font_name, font_size); 119 | return 1; 120 | } 121 | 122 | if (width == -1 || height == -1) { 123 | int w = 0, h = 0; 124 | font_calculate_box(font, &w, &h, string); 125 | if (width == -1) width = w; 126 | if (height == -1) height = h; 127 | } 128 | 129 | uint8_t *canvas = malloc(((size_t)width * (size_t)height) + 1); 130 | memset(canvas, ' ', (size_t)width * (size_t)height); 131 | 132 | char *p = string; 133 | 134 | int x = 0; 135 | char prev = 0; 136 | while (*p) { 137 | x += font_draw_char_L(font, x, 0, width, height, canvas, *p, prev); 138 | prev = *p; 139 | p++; 140 | } 141 | 142 | for (int y = 0; y < height; y++) { 143 | uint8_t *p = canvas + (y * width); 144 | uint8_t *q = p + width; 145 | uint8_t ch = *q; 146 | *q = '\0'; 147 | puts((const char *)p); 148 | *q = ch; 149 | } 150 | 151 | return 0; 152 | } 153 | -------------------------------------------------------------------------------- /src/resource/fontem.h: -------------------------------------------------------------------------------- 1 | /** Font structure definitions. 2 | * 3 | * This file is distributed under the terms of the MIT License. 4 | * See the LICENSE file at the top of this tree, or if it is missing a copy can 5 | * be found at http://opensource.org/licenses/MIT 6 | */ 7 | 8 | #ifndef _FONTEM_H 9 | #define _FONTEM_H 10 | 11 | #include 12 | #include 13 | 14 | /** Alpha compositing "A over B" mechanism */ 15 | #define alpha_blend(in, in_alpha, out, out_alpha) \ 16 | ((0x100 * in * in_alpha * (255 - out_alpha) + out * out_alpha * (255 - in_alpha)) >> 16) 17 | #define blend(a, b, alpha) \ 18 | (((a) * (255 - (alpha)) + (b) * (alpha)) >> 8) 19 | 20 | /** Extract the Alpha channel from a 32-bit RGBA value */ 21 | #define rgba32_get_a(rgba) ((rgba >> 24) & 0xff) 22 | /** Extract the Red channel from a 32-bit RGBA value */ 23 | #define rgba32_get_r(rgba) ((rgba >> 16) & 0xff) 24 | /** Extract the Green channel from a 32-bit RGBA value */ 25 | #define rgba32_get_g(rgba) ((rgba >> 8) & 0xff) 26 | /** Extract the Blue channel from a 32-bit RGBA value */ 27 | #define rgba32_get_b(rgba) (rgba & 0xff) 28 | 29 | /** Extract the Red channel from a 16-bit RGB value */ 30 | #define rgb16_get_r(rgb) ((rgb >> 8) & 0xf8) 31 | /** Extract the Green channel from a 16-bit RGB value */ 32 | #define rgb16_get_g(rgb) ((rgb >> 3) & 0xfc) 33 | /** Extract the Blue channel from a 16-bit RGB value */ 34 | #define rgb16_get_b(rgb) ((rgb << 3) & 0xf8) 35 | /** Combine Red, Green and Blue channels into a 16-bit RGB value */ 36 | #define rgb16_combine(r, g, b) \ 37 | ((((r) & 0xf8) << 8) | \ 38 | (((g) & 0xfc) << 3) | \ 39 | (((b) & 0xf8) >> 3)) 40 | 41 | 42 | /** Glyph character value rype */ 43 | typedef uint16_t glyph_t; 44 | 45 | /** Description of a glyph; a single character in a font. */ 46 | struct glyph { 47 | glyph_t glyph; /** The glyph this entry refers to */ 48 | 49 | int16_t left; /** Offset of the left edge of the glyph */ 50 | int16_t top; /** Offset of the top edge of the glyph */ 51 | int16_t advance; /** Horizonal offset when advancing to the next glyph */ 52 | 53 | uint16_t cols; /** Width of the bitmap */ 54 | uint16_t rows; /** Height of the bitmap */ 55 | const uint8_t *bitmap; /** Bitmap data */ 56 | 57 | const struct kerning *kerning; /** Font kerning data */ 58 | }; 59 | 60 | /** Kerning table; for a pair of glyphs, provides the horizontal adjustment. */ 61 | struct kerning { 62 | glyph_t left; /** The left-glyph */ 63 | int16_t offset; /** The kerning offset for this glyph pair */ 64 | }; 65 | 66 | /** Description of a font. */ 67 | struct font { 68 | char *name; /** Name of the font */ 69 | char *style; /** Style of the font */ 70 | 71 | uint16_t size; /** Point size of the font */ 72 | uint16_t dpi; /** Resolution of the font */ 73 | 74 | int16_t ascender; /** Ascender height */ 75 | int16_t descender; /** Descender height */ 76 | int16_t height; /** Baseline-to-baseline height */ 77 | 78 | uint16_t count; /** Number of glyphs */ 79 | uint16_t max; /** Maximum glyph index */ 80 | const struct glyph **glyphs; /** Font glyphs */ 81 | char compressed; /** TRUE if glyph bitmaps are RLE compressed */ 82 | }; 83 | 84 | 85 | /* fontrender.c */ 86 | const struct glyph *font_get_glyph(const struct font *font, glyph_t glyph); 87 | int16_t font_get_kerning(const struct font *font, glyph_t left, glyph_t right); 88 | int font_calculate_box(const struct font *font, int *maxx, int *maxy, const char *str); 89 | 90 | /* fontrender_l.c */ 91 | int font_draw_glyph_L(const struct font *font, int x, int y, int width, int height, uint8_t *buf, const struct glyph *g); 92 | int font_draw_char_L(const struct font *font, int x, int y, int width, int height, uint8_t *buf, glyph_t glyph, glyph_t prev); 93 | 94 | /* fontrender_rgba32.c */ 95 | int font_draw_glyph_RGBA32(const struct font *font, int x, int y, int width, int height, uint8_t *buf, const struct glyph *g, uint32_t rgb); 96 | int font_draw_char_RGBA32(const struct font *font, int x, int y, int width, int height, uint8_t *buf, glyph_t glyph, glyph_t prev, uint32_t rgb); 97 | 98 | /* fontrender_rgb16.c */ 99 | int font_draw_glyph_RGB16(const struct font *font, int x, int y, int width, int height, uint8_t *buf, const struct glyph *g, uint16_t rgb); 100 | int font_draw_char_RGB16(const struct font *font, int x, int y, int width, int height, uint8_t *buf, glyph_t glyph, glyph_t prev, uint16_t rgb); 101 | char *font_draw_string_RGB16(const struct font *font, int x, int y, int width, int height, uint8_t *buf, char *str, char prev, uint16_t rgb); 102 | 103 | /* fontfind.c */ 104 | const struct font *font_find_all(const char *name, const char *style, const int size, const char rle); 105 | const struct font *font_find(const char *name, const char *style, const int size); 106 | typedef void (*fia_fn_t)(struct font *, void *); 107 | void font_iterate_all(fia_fn_t fn, void *opaque); 108 | 109 | #endif /* _FONTEM_H */ 110 | -------------------------------------------------------------------------------- /tests/test-data/41fcb752d1b2ab9c06ddeae947fd35da: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | X +XXX XXX+ 5 | XXXXXXXXXXXXXX +XXX+ XX .XXXXX. .+XXXX+ XXX X .XXX. X. +XX+ +XXX+ X +X+ +X+ 6 | X XX X XX XX XX .XXX XX+ +XX XX+ .XX. XXX .+XXXX+. X X+ +X .X +XXXX+ .XX .XX X XX XX 7 | X XX X XX XX XX .X.XX X+ +X+ X+ XX +X+ .XX+ .+X. .XXXX+ +X .X+ X +XX..XX+ XX .X .+ X +. XX XX 8 | X XX X XX .X+ +X X XX X XX X XX +X+ XX. X+ XX. X XX XX XX +. +XX XX+ XX X .XX+ X +XX. XX XX 9 | XX XX +X. .X+ XX XX .X+ .X. XX. X. +X X .X XX XX .X +X+ +X+ XX. +XXX+ XX XX 10 | XX +XXX+. .XXXX+ XXXXXXX XX XX XX XX .X+ .X. +X. X XX X X XX XX X +X. .X+ +XX +XXX+ XX XX 11 | XX .X+ +X. .X+ XX XX XX XX XX +X. XXXX. X XX +XX+ XX ++ XX+ X +X .X+ ++ .XXX .XX+ X +XX. XX XX 12 | XX XX +X XX X XX XX XX XX X+ .XX. X .X. XX. .XXX X +XXX.X X+ +X .X .XXX. .X.XXX XXXXXX .+ X +. +X. .X+ 13 | XX +X. .X+ XX+ XX XX XX XX XX XX X XX +X. .XX X +XXXXX. .XXX. X. X+ +X X+ XXX X X .XXX. .XXX. 14 | XX XX XX +XXX+. XX XX XX XX XX .X+ X XX XX XX X .+XXXX ++ +X .X+ +X XXX .+ X XX. .XX 15 | XX XXXXXXXXXXX .XXXXX. XX XX XX XX XX XX X XX XX XX X X.XX+ X XX XX XX XXX X. XX XX 16 | XX XX .XXX+ XX +X. .X+ XX XX XX XX XX XX +. X .XX X. XX XX XX XXX XX XX XX 17 | XX +X .XX XX .X+ +X XX ++ X X XX XX +X. .XX .X X X XX .+ XX XX XX. XXXX XX XX 18 | XX X+ .X+ X XX XX XX XX XX XX ++ X X+ +X. +X+ +X. XX. .XXX +X X. X X+ X +X .X+ .XX .XXX. XX XX 19 | XX .X+ .XX XX +X. +X .X+ XX XX XX +XXXXXXXXX XX+ +X+ XXX XX +XX+ XX+. XX+ X +X X. X+ +X +XX. .+X++XX XX XX 20 | XXXXXX +XXXX+ +XXXX+. +XX+ +XXX+ XXXXXXXX XXXXXXXXXX ++XXXX+. +X+ +X. .+XXXX+ .X .XXX. .+XXXX+ +XXXX XX XX 21 | XX X XX XX 22 | XX. + X +X. .X+ 23 | +XX. .X+ X +XXX XXX+ 24 | .+XXXX+ 25 | XXXXXXXXXXX 26 | 27 | -------------------------------------------------------------------------------- /tests/test-data/65b10a2c6adfa411bba7a7fe7f2801cc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | X +XXX XXX+ 5 | XXXXXXXXXXXXXX +XXX+ XX .XXXXX. .+XXXX+ XXX X .XXX. X. +XX+ +XXX+ X +X+ +X+ 6 | X XX X XX XX XX .XXX XX+ +XX XX+ .XX. XXX .+XXXX+. X X+ +X .X +XXXX+ .XX .XX X XX XX 7 | X XX X XX XX XX .X.XX X+ +X+ X+ XX +X+ .XX+ .+X. .XXXX+ +X .X+ X +XX..XX+ XX .X .+ X +. XX XX 8 | X XX X XX .X+ +X X XX X XX X XX +X+ XX. X+ XX. X XX XX XX +. +XX XX+ XX X .XX+ X +XX. XX XX 9 | XX XX +X. .X+ XX XX .X+ .X. XX. X. +X X .X XX XX .X +X+ +X+ XX. +XXX+ XX XX 10 | XX +XXX+. .XXXX+ XXXXXXX XX XX XX XX .X+ .X. +X. X XX X X XX XX X +X. .X+ +XX +XXX+ XX XX 11 | XX .X+ +X. .X+ XX XX XX XX XX +X. XXXX. X XX +XX+ XX ++ XX+ X +X .X+ ++ .XXX .XX+ X +XX. XX XX 12 | XX XX +X XX X XX XX XX XX X+ .XX. X .X. XX. .XXX X +XXX.X X+ +X .X .XXX. .X.XXX XXXXXX .+ X +. +X. .X+ 13 | XX +X. .X+ XX+ XX XX XX XX XX XX X XX +X. .XX X +XXXXX. .XXX. X. X+ +X X+ XXX X X .XXX. .XXX. 14 | XX XX XX +XXX+. XX XX XX XX XX .X+ X XX XX XX X .+XXXX ++ +X .X+ +X XXX .+ X XX. .XX 15 | XX XXXXXXXXXXX .XXXXX. XX XX XX XX XX XX X XX XX XX X X.XX+ X XX XX XX XXX X. XX XX 16 | XX XX .XXX+ XX +X. .X+ XX XX XX XX XX XX +. X .XX X. XX XX XX XXX XX XX XX 17 | XX +X .XX XX .X+ +X XX ++ X X XX XX +X. .XX .X X X XX .+ XX XX XX. XXXX XX XX 18 | XX X+ .X+ X XX XX XX XX XX XX ++ X X+ +X. +X+ +X. XX. .XXX +X X. X X+ X +X .X+ .XX .XXX. XX XX 19 | XX .X+ .XX XX +X. +X .X+ XX XX XX +XXXXXXXXX XX+ +X+ XXX XX +XX+ XX+. XX+ X +X X. X+ +X +XX. .+X++XX XX XX 20 | XXXXXX +XXXX+ +XXXX+. +XX+ +XXX+ XXXXXXXX XXXXXXXXXX ++XXXX+. +X+ +X. .+XXXX+ .X .XXX. .+XXXX+ +XXXX XX XX 21 | XX X XX XX 22 | XX. + X +X. .X+ 23 | +XX. .X+ X +XXX XXX+ 24 | .+XXXX+ 25 | XXXXXXXXXXX 26 | 27 | -------------------------------------------------------------------------------- /aclocal/ax_cflags_gcc_option.m4: -------------------------------------------------------------------------------- 1 | dnl @synopsis AX_CFLAGS_GCC_OPTION (optionflag [,[shellvar][,[A][,[NA]]]) 2 | dnl 3 | dnl AX_CFLAGS_GCC_OPTION(-fvomit-frame) would show a message as like 4 | dnl "checking CFLAGS for gcc -fvomit-frame ... yes" and adds the 5 | dnl optionflag to CFLAGS if it is understood. You can override the 6 | dnl shellvar-default of CFLAGS of course. The order of arguments stems 7 | dnl from the explicit macros like AX_CFLAGS_WARN_ALL. 8 | dnl 9 | dnl The cousin AX_CXXFLAGS_GCC_OPTION would check for an option to add 10 | dnl to CXXFLAGS - and it uses the autoconf setup for C++ instead of C 11 | dnl (since it is possible to use different compilers for C and C++). 12 | dnl 13 | dnl The macro is a lot simpler than any special AX_CFLAGS_* macro (or 14 | dnl ac_cxx_rtti.m4 macro) but allows to check for arbitrary options. 15 | dnl However, if you use this macro in a few places, it would be great 16 | dnl if you would make up a new function-macro and submit it to the 17 | dnl ac-archive. 18 | dnl 19 | dnl - $1 option-to-check-for : required ("-option" as non-value) 20 | dnl - $2 shell-variable-to-add-to : CFLAGS (or CXXFLAGS in the other case) 21 | dnl - $3 action-if-found : add value to shellvariable 22 | dnl - $4 action-if-not-found : nothing 23 | dnl 24 | dnl note: in earlier versions, $1-$2 were swapped. We try to detect the 25 | dnl situation and accept a $2=~/-/ as being the old 26 | dnl option-to-check-for. 27 | dnl 28 | dnl also: there are other variants that emerged from the original macro 29 | dnl variant which did just test an option to be possibly added. 30 | dnl However, some compilers accept an option silently, or possibly for 31 | dnl just another option that was not intended. Therefore, we have to do 32 | dnl a generic test for a compiler family. For gcc we check "-pedantic" 33 | dnl being accepted which is also understood by compilers who just want 34 | dnl to be compatible with gcc even when not being made from gcc 35 | dnl sources. 36 | dnl 37 | dnl see also: 38 | dnl 39 | dnl AX_CFLAGS_SUN_OPTION AX_CFLAGS_HPUX_OPTION 40 | dnl AX_CFLAGS_AIX_OPTION AX_CFLAGS_IRIX_OPTION 41 | dnl 42 | dnl @category C 43 | dnl @author Guido U. Draheim 44 | dnl @version 2006-12-12 45 | dnl @license GPLWithACException 46 | 47 | AC_DEFUN([AX_CFLAGS_GCC_OPTION_OLD], [dnl 48 | AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl 49 | AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_gcc_option_$2])dnl 50 | AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for gcc m4_ifval($2,$2,-option)], 51 | VAR,[VAR="no, unknown" 52 | AC_LANG_SAVE 53 | AC_LANG_C 54 | ac_save_[]FLAGS="$[]FLAGS" 55 | for ac_arg dnl 56 | in "-pedantic -Werror % m4_ifval($2,$2,-option)" dnl GCC 57 | "-pedantic % m4_ifval($2,$2,-option) %% no, obsolete" dnl new GCC 58 | # 59 | do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'` 60 | AC_TRY_COMPILE([],[return 0;], 61 | [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break]) 62 | done 63 | FLAGS="$ac_save_[]FLAGS" 64 | AC_LANG_RESTORE 65 | ]) 66 | case ".$VAR" in 67 | .ok|.ok,*) m4_ifvaln($3,$3) ;; 68 | .|.no|.no,*) m4_ifvaln($4,$4) ;; 69 | *) m4_ifvaln($3,$3,[ 70 | if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null 71 | then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR]) 72 | else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"]) 73 | m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR" 74 | fi ]) ;; 75 | esac 76 | AS_VAR_POPDEF([VAR])dnl 77 | AS_VAR_POPDEF([FLAGS])dnl 78 | ]) 79 | 80 | 81 | dnl the only difference - the LANG selection... and the default FLAGS 82 | 83 | AC_DEFUN([AX_CXXFLAGS_GCC_OPTION_OLD], [dnl 84 | AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl 85 | AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_gcc_option_$2])dnl 86 | AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for gcc m4_ifval($2,$2,-option)], 87 | VAR,[VAR="no, unknown" 88 | AC_LANG_SAVE 89 | AC_LANG_CPLUSPLUS 90 | ac_save_[]FLAGS="$[]FLAGS" 91 | for ac_arg dnl 92 | in "-pedantic -Werror % m4_ifval($2,$2,-option)" dnl GCC 93 | "-pedantic % m4_ifval($2,$2,-option) %% no, obsolete" dnl new GCC 94 | # 95 | do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'` 96 | AC_TRY_COMPILE([],[return 0;], 97 | [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break]) 98 | done 99 | FLAGS="$ac_save_[]FLAGS" 100 | AC_LANG_RESTORE 101 | ]) 102 | case ".$VAR" in 103 | .ok|.ok,*) m4_ifvaln($3,$3) ;; 104 | .|.no|.no,*) m4_ifvaln($4,$4) ;; 105 | *) m4_ifvaln($3,$3,[ 106 | if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null 107 | then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR]) 108 | else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"]) 109 | m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR" 110 | fi ]) ;; 111 | esac 112 | AS_VAR_POPDEF([VAR])dnl 113 | AS_VAR_POPDEF([FLAGS])dnl 114 | ]) 115 | 116 | dnl ------------------------------------------------------------------------- 117 | 118 | AC_DEFUN([AX_CFLAGS_GCC_OPTION_NEW], [dnl 119 | AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl 120 | AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_gcc_option_$1])dnl 121 | AC_CACHE_CHECK([m4_ifval($2,$2,FLAGS) for gcc m4_ifval($1,$1,-option)], 122 | VAR,[VAR="no, unknown" 123 | AC_LANG_SAVE 124 | AC_LANG_C 125 | ac_save_[]FLAGS="$[]FLAGS" 126 | for ac_arg dnl 127 | in "-pedantic -Werror % m4_ifval($1,$1,-option)" dnl GCC 128 | "-pedantic % m4_ifval($1,$1,-option) %% no, obsolete" dnl new GCC 129 | # 130 | do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'` 131 | AC_TRY_COMPILE([],[return 0;], 132 | [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break]) 133 | done 134 | FLAGS="$ac_save_[]FLAGS" 135 | AC_LANG_RESTORE 136 | ]) 137 | case ".$VAR" in 138 | .ok|.ok,*) m4_ifvaln($3,$3) ;; 139 | .|.no|.no,*) m4_ifvaln($4,$4) ;; 140 | *) m4_ifvaln($3,$3,[ 141 | if echo " $[]m4_ifval($2,$2,FLAGS) " | grep " $VAR " 2>&1 >/dev/null 142 | then AC_RUN_LOG([: m4_ifval($2,$2,FLAGS) does contain $VAR]) 143 | else AC_RUN_LOG([: m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR"]) 144 | m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR" 145 | fi ]) ;; 146 | esac 147 | AS_VAR_POPDEF([VAR])dnl 148 | AS_VAR_POPDEF([FLAGS])dnl 149 | ]) 150 | 151 | 152 | dnl the only difference - the LANG selection... and the default FLAGS 153 | 154 | AC_DEFUN([AX_CXXFLAGS_GCC_OPTION_NEW], [dnl 155 | AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl 156 | AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_gcc_option_$1])dnl 157 | AC_CACHE_CHECK([m4_ifval($2,$2,FLAGS) for gcc m4_ifval($1,$1,-option)], 158 | VAR,[VAR="no, unknown" 159 | AC_LANG_SAVE 160 | AC_LANG_CPLUSPLUS 161 | ac_save_[]FLAGS="$[]FLAGS" 162 | for ac_arg dnl 163 | in "-pedantic -Werror % m4_ifval($1,$1,-option)" dnl GCC 164 | "-pedantic % m4_ifval($1,$1,-option) %% no, obsolete" dnl new GCC 165 | # 166 | do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'` 167 | AC_TRY_COMPILE([],[return 0;], 168 | [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break]) 169 | done 170 | FLAGS="$ac_save_[]FLAGS" 171 | AC_LANG_RESTORE 172 | ]) 173 | case ".$VAR" in 174 | .ok|.ok,*) m4_ifvaln($3,$3) ;; 175 | .|.no|.no,*) m4_ifvaln($4,$4) ;; 176 | *) m4_ifvaln($3,$3,[ 177 | if echo " $[]m4_ifval($2,$2,FLAGS) " | grep " $VAR " 2>&1 >/dev/null 178 | then AC_RUN_LOG([: m4_ifval($2,$2,FLAGS) does contain $VAR]) 179 | else AC_RUN_LOG([: m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR"]) 180 | m4_ifval($2,$2,FLAGS)="$m4_ifval($2,$2,FLAGS) $VAR" 181 | fi ]) ;; 182 | esac 183 | AS_VAR_POPDEF([VAR])dnl 184 | AS_VAR_POPDEF([FLAGS])dnl 185 | ]) 186 | 187 | AC_DEFUN([AX_CFLAGS_GCC_OPTION],[ifelse(m4_bregexp([$2],[-]),-1, 188 | [AX_CFLAGS_GCC_OPTION_NEW($@)],[AX_CFLAGS_GCC_OPTION_OLD($@)])]) 189 | 190 | AC_DEFUN([AX_CXXFLAGS_GCC_OPTION],[ifelse(m4_bregexp([$2],[-]),-1, 191 | [AX_CXXFLAGS_GCC_OPTION_NEW($@)],[AX_CXXFLAGS_GCC_OPTION_OLD($@)])]) 192 | -------------------------------------------------------------------------------- /src/fontem.c: -------------------------------------------------------------------------------- 1 | /** 2 | * \file src/fontem.c 3 | * 4 | * This file is distributed under the terms of the MIT License. 5 | * See the LICENSE file at the top of this tree, or if it is missing a copy can 6 | * be found at http://opensource.org/licenses/MIT 7 | */ 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | #include 20 | #include FT_FREETYPE_H 21 | 22 | #define DEFAULT_CHAR_LIST "!@#$%^&*()_+-={}|[]\\:\";'<>?,./`~" \ 23 | " " \ 24 | "ABCDEFGHIJKLMNOPQRSTUVWXYZ" \ 25 | "abcdefghijklmnopqrstuvwxyz" \ 26 | "0123456789" \ 27 | "ÄÖÜßäöü" 28 | 29 | #define FONT_DPI 100 30 | 31 | /** Font library handle */ 32 | FT_Library library; 33 | char *section = NULL; 34 | 35 | void store_glyph(FT_Face *face, FT_GlyphSlotRec *glyph, int ch, int size, char *name, FILE *c, char **post, int *post_len, int *post_count, int with_kerning, wchar_t *char_list, int compress, int rotate, int mono); 36 | static char *get_section(char *name); 37 | static int cmp_wchar(const void *p1, const void *p2); 38 | 39 | static char *mb(wchar_t wchar) 40 | { 41 | static char ch_mb[16]; 42 | int mb_len = wctomb(ch_mb, wchar); 43 | 44 | ch_mb[mb_len] = '\0'; 45 | return ch_mb; 46 | } 47 | 48 | static char *validate_identifier(const char *identifier) 49 | { 50 | char *result = strdup(identifier); 51 | 52 | for (char *p = result; *p; p++) { 53 | if (isdigit(*p) && (p == result)) 54 | *p = '_'; 55 | #ifndef __GNUC__ 56 | else if (*p == '$') 57 | *p = '_'; 58 | #endif 59 | else if (!isalnum(*p)) 60 | *p = '_'; 61 | } 62 | return result; 63 | } 64 | 65 | int main(int argc, const char *argv[]) 66 | { 67 | setlocale(LC_ALL, ""); 68 | 69 | int len, error; 70 | int rle = 0; 71 | int rotate = 0; 72 | int mono = 0; 73 | 74 | char *font_filename = NULL; 75 | char *char_list = strdup(DEFAULT_CHAR_LIST); 76 | char *output_name = NULL; 77 | char *output_dir = "."; 78 | char *append = ""; 79 | char *append_sane = NULL; 80 | int font_size = 10; 81 | 82 | struct poptOption opts[] = { 83 | { "font", 'f', POPT_ARG_STRING | POPT_ARGFLAG_SHOW_DEFAULT, &font_filename, 1, "Font filename", "file" }, 84 | { "size", 's', POPT_ARG_INT | POPT_ARGFLAG_SHOW_DEFAULT, &font_size, 1, "Font size", "integer" }, 85 | { "chars", 'c', POPT_ARG_STRING | POPT_ARGFLAG_SHOW_DEFAULT, &char_list, 1, "List of characters to produce", "string" }, 86 | { "name", 'n', POPT_ARG_STRING | POPT_ARGFLAG_SHOW_DEFAULT, &output_name, 1, "Output name (without extension)", "file" }, 87 | { "dir", 'd', POPT_ARG_STRING | POPT_ARGFLAG_SHOW_DEFAULT, &output_dir, 1, "Output directory", "dir" }, 88 | { "section", 0, POPT_ARG_STRING, §ion, 1, "Section for font data", "name" }, 89 | { "rle", 0, POPT_ARG_VAL | POPT_ARGFLAG_SHOW_DEFAULT, &rle, 1, "Use RLE compression", "rle" }, 90 | { "append", 0, POPT_ARG_STRING | POPT_ARGFLAG_SHOW_DEFAULT, &append, 1, "Append str to filename, structs", "" }, 91 | { "rotate", 'r', POPT_ARG_VAL | POPT_ARGFLAG_SHOW_DEFAULT, &rotate, 1, "Rotate bitmap by 90 cw", "" }, 92 | { "mono", 'm', POPT_ARG_VAL | POPT_ARGFLAG_SHOW_DEFAULT, &mono, 1, "Mono typeface", "" }, 93 | POPT_AUTOHELP 94 | POPT_TABLEEND 95 | }; 96 | 97 | poptContext ctx = poptGetContext(NULL, argc, argv, opts, 0); 98 | int rc; 99 | 100 | while ((rc = poptGetNextOpt(ctx)) > 0) { 101 | switch (rc) { 102 | case 1: 103 | /* No-op */ 104 | break; 105 | 106 | default: 107 | fprintf(stderr, "ERROR: Unexpected option value '%d'.\n", rc); 108 | return 1; 109 | } 110 | } 111 | 112 | poptFreeContext(ctx); 113 | 114 | if (font_filename == NULL) { 115 | fprintf(stderr, "ERROR: You must specify a font filename.\n"); 116 | return 1; 117 | } 118 | 119 | if (output_name == NULL) { 120 | fprintf(stderr, "ERROR: You must specify an output name.\n"); 121 | return 1; 122 | } 123 | 124 | // Make a copy of 'append' with C-sane characters 125 | append_sane = validate_identifier(append); 126 | 127 | // Convert the char list into wide characters and sort it 128 | size_t char_count = mbstowcs(NULL, char_list, 0); 129 | if (char_count == (size_t)-1) { 130 | perror("converting char list"); 131 | return 1; 132 | } 133 | wchar_t *wide_char_list = (wchar_t *)calloc(char_count + 1, sizeof(wchar_t)); 134 | char_count = mbstowcs(wide_char_list, char_list, char_count + 1); 135 | qsort(wide_char_list, char_count, sizeof(wchar_t), cmp_wchar); 136 | 137 | // Init the font library 138 | error = FT_Init_FreeType(&library); 139 | if (error) { 140 | fprintf(stderr, "ERROR: Can't initialize FreeType.\n"); 141 | return 1; 142 | } 143 | 144 | // Load the font 145 | FT_Face face; 146 | error = FT_New_Face(library, font_filename, 0, &face); 147 | if (error) { 148 | fprintf(stderr, "ERROR: Can't load '%s'.\n", font_filename); 149 | return 1; 150 | } 151 | 152 | // Set the size 153 | error = FT_Set_Char_Size(face, font_size * 64, 0, FONT_DPI, 0); 154 | if (error) { 155 | fprintf(stderr, "ERROR: Can't set the font size to %d", font_size); 156 | return 1; 157 | } 158 | 159 | char *font_name = face->family_name; 160 | 161 | // Open the output files 162 | len = strlen(output_dir) + strlen(output_name) + strlen(append) + 32; 163 | char *c_name = malloc(len); 164 | snprintf(c_name, len, "%s/font-%s-%d%s.c", 165 | output_dir, 166 | output_name, 167 | font_size, 168 | append); 169 | FILE *c = fopen(c_name, "w"); 170 | if (c == NULL) { 171 | fprintf(stderr, "ERROR: Can't open '%s' for writing: %s\n", 172 | c_name, strerror(errno)); 173 | return 1; 174 | } 175 | 176 | char *h_name = malloc(len); 177 | snprintf(h_name, len, "%s/font-%s-%d%s.h", 178 | output_dir, 179 | output_name, 180 | font_size, 181 | append); 182 | FILE *h = fopen(h_name, "w"); 183 | if (h == NULL) { 184 | fprintf(stderr, "ERROR: Can't open '%s' for writing: %s\n", 185 | h_name, strerror(errno)); 186 | return 1; 187 | } 188 | char *h_basename = strrchr(h_name, '/'); 189 | if (h_basename == NULL) h_basename = h_name; 190 | else h_basename++; 191 | 192 | // Fix output name for the C identifier 193 | char *output_name_c = validate_identifier(output_name); 194 | 195 | // Initial output in the .c file 196 | fprintf(c, "%s", 197 | "/* AUTOMATICALLY GENERATED FILE! EDITING NOT RECOMMENDED!\n" 198 | " *\n" 199 | " * This file is distributed under the terms of the MIT License.\n" 200 | " * See the LICENSE file at the top of this tree, or if it is missing a copy can\n" 201 | " * be found at http://opensource.org/licenses/MIT\n" 202 | " */\n\n"); 203 | fprintf(c, "#include \n"); 204 | fprintf(c, "#include \n"); 205 | fprintf(c, "#include \"fontem.h\"\n"); 206 | fprintf(c, "#include \"%s\"\n\n", h_basename); 207 | fprintf(c, "/* Character list: %s */\n\n", char_list); 208 | 209 | // Initial output in the .h file 210 | fprintf(h, "%s", 211 | "/* AUTOMATICALLY GENERATED FILE! EDITING NOT RECOMMENDED!\n" 212 | " *\n" 213 | " * This file is distributed under the terms of the MIT License.\n" 214 | " * See the LICENSE file at the top of this tree, or if it is missing a copy can\n" 215 | " * be found at http://opensource.org/licenses/MIT\n" 216 | " */\n\n"); 217 | fprintf(h, "#ifndef _FONTEM_%s_%d%s_H\n#define _FONTEM_%s_%d%s_H\n\n", 218 | output_name_c, font_size, append_sane, 219 | output_name_c, font_size, append_sane); 220 | fprintf(h, "#include \"fontem.h\"\n\n"); 221 | 222 | 223 | // Postamble for the c file 224 | char *post = malloc(512); 225 | snprintf(post, 512, "/** Glyphs table for font \"%s\". */\n" \ 226 | "static const struct glyph *glyphs_%s_%d%s[] %s= {\n", 227 | font_name, output_name_c, font_size, append_sane, 228 | get_section(output_name_c)); 229 | int post_len = strlen(post); 230 | post = realloc(post, post_len + 1); 231 | int post_count = 0; 232 | wchar_t post_max = 0; 233 | 234 | // Are we kerning? 235 | int with_kerning = FT_HAS_KERNING(face); 236 | 237 | // Iterate the character list and generate the bitmap for each 238 | for (size_t i = 0; i < char_count; i++) { 239 | wchar_t ch = wide_char_list[i]; 240 | if (ch > post_max) 241 | post_max = ch; 242 | 243 | // Load the glyph 244 | if (mono) 245 | error = FT_Load_Char(face, ch, FT_LOAD_RENDER | FT_LOAD_TARGET_MONO); 246 | else 247 | error = FT_Load_Char(face, ch, FT_LOAD_RENDER); 248 | 249 | if (error) { 250 | fprintf(stderr, "ERROR : Can't load glyph for %s.\n", mb(ch)); 251 | return 1; 252 | } 253 | 254 | store_glyph(&face, face->glyph, ch, font_size, output_name_c, c, &post, 255 | &post_len, &post_count, with_kerning, wide_char_list, rle, rotate, mono); 256 | } 257 | 258 | // Finish the post 259 | fprintf(c, "%s" \ 260 | "};\n\n", post); 261 | free(post); 262 | 263 | fprintf(c, "/** Definition for font \"%s\". */\n", font_name); 264 | fprintf(c, "const struct font font_%s_%d%s %s= {\n" \ 265 | "\t.name = \"%s\",\n" \ 266 | "\t.style = \"%s\",\n" \ 267 | "\t.size = %d,\n" \ 268 | "\t.dpi = %d,\n" \ 269 | "\t.count = %d,\n" \ 270 | "\t.max = %d,\n" \ 271 | "\t.ascender = %d,\n" \ 272 | "\t.descender = %d,\n" \ 273 | "\t.height = %d,\n" \ 274 | "\t.glyphs = glyphs_%s_%d%s,\n" \ 275 | "\t.compressed = %u,\n" \ 276 | "};\n\n", 277 | output_name_c, font_size, append_sane, 278 | get_section(output_name_c), 279 | font_name, face->style_name, font_size, FONT_DPI, 280 | post_count, post_max, 281 | (int)face->size->metrics.ascender / 64, 282 | (int)face->size->metrics.descender / 64, 283 | (int)face->size->metrics.height / 64, 284 | output_name_c, font_size, append_sane, 285 | rle); 286 | 287 | // Add the reference to the .h 288 | fprintf(h, "extern const struct font font_%s_%d%s;\n\n", 289 | output_name_c, font_size, append_sane); 290 | 291 | // All done! 292 | fprintf(h, "#endif /* _FONTEM_%s_%d%s_H */\n", 293 | output_name_c, font_size, append_sane); 294 | free(output_name_c); 295 | fclose(h); 296 | fclose(c); 297 | 298 | return 0; 299 | } 300 | 301 | static inline char get_class(unsigned char c) 302 | { 303 | if (c == 0) 304 | return 1; 305 | else if (c == 0xff) 306 | return 2; 307 | else 308 | return 3; 309 | } 310 | 311 | static unsigned char *rle_compress(const unsigned char *data, size_t *length) 312 | { 313 | size_t in_length = *length, out_length = 0; 314 | unsigned char *result = (unsigned char *)malloc(2 * in_length); 315 | unsigned char class = 0, count = 0; 316 | 317 | for (size_t i = 0; i <= in_length; i++) { 318 | unsigned char c = data[i]; 319 | unsigned char c_class = (i == in_length ? 0 : get_class(c)); 320 | 321 | if (((count > 0) && (class != c_class)) || (count >= 0x40)) { 322 | if (class == 3) { 323 | result[out_length] = count - 1; 324 | out_length++; 325 | 326 | memcpy(result + out_length, data + i - count, count); 327 | out_length += count; 328 | } else { 329 | result[out_length] = (class == 1 ? 0x80 : 0xc0) + count - 1; 330 | out_length++; 331 | } 332 | count = 0; 333 | } 334 | class = c_class; 335 | count++; 336 | } 337 | 338 | *length = out_length; 339 | return result; 340 | } 341 | 342 | static void store_bitmap(FILE *c, FT_Bitmap *bitmap, char *bname, wchar_t ch, int compress, int rotate, int mono) 343 | { 344 | if (bitmap->rows && bitmap->width) { 345 | fprintf(c, "/** Bitmap definition for character '%s'. */\n", mb(ch)); 346 | fprintf(c, "static const uint8_t %s[] %s= {\n", bname, get_section(bname)); 347 | if (compress) { 348 | size_t length = (size_t)bitmap->rows * (size_t)bitmap->width; 349 | unsigned char *compressed_data = rle_compress(bitmap->buffer, &length); 350 | fprintf(c, "\t"); 351 | for (size_t i = 0; i < length; i++) { 352 | fprintf(c, "0x%02x, ", compressed_data[i]); 353 | if (i == length - 1) 354 | fprintf(c, "\n"); 355 | else if ((i % 16) == 15) 356 | fprintf(c, "\n\t"); 357 | } 358 | free(compressed_data); 359 | } else { 360 | if (rotate) { 361 | if (mono) { 362 | unsigned int byte_rows = bitmap->rows / 8; 363 | if (bitmap->rows & 7) byte_rows++; 364 | 365 | unsigned char *out = malloc((size_t)byte_rows * bitmap->width); 366 | memset(out, 0, (size_t)byte_rows * bitmap->width); 367 | 368 | unsigned int x, y; 369 | 370 | printf("\n"); 371 | for (y = 0; y < bitmap->rows; y++) { 372 | for (x = 0; x < bitmap->width; x++) { 373 | unsigned int s_byte = (x / 8) + (y * bitmap->pitch); 374 | unsigned int s_bit = x % 8; 375 | unsigned char s_mask = 128 >> s_bit; 376 | 377 | unsigned int d_byte = (y / 8) + (x * byte_rows); 378 | unsigned int d_bit = y % 8; 379 | 380 | if (bitmap->buffer[s_byte] & s_mask) 381 | out[d_byte] |= 128 >> d_bit; 382 | } 383 | printf("\n"); 384 | } 385 | 386 | for (x = 0; x < bitmap->width; x++) { 387 | fprintf(c, "\t"); 388 | for (y = 0; y < byte_rows; y++) 389 | fprintf(c, "0x%02x, ", out[x * byte_rows + y]); 390 | fprintf(c, "\n"); 391 | } 392 | 393 | free(out); 394 | } else { 395 | for (unsigned int x = 0; x < (unsigned int)bitmap->pitch; x++) { 396 | fprintf(c, "\t"); 397 | for (unsigned int y = 0; y < (unsigned int)bitmap->rows; y++) 398 | fprintf(c, "0x%02x, ", (unsigned char)bitmap->buffer[y * bitmap->pitch + x]); 399 | fprintf(c, "\n"); 400 | } 401 | } 402 | } else { 403 | for (unsigned int y = 0; y < (unsigned int)bitmap->rows; y++) { 404 | fprintf(c, "\t"); 405 | for (unsigned int x = 0; x < (unsigned int)bitmap->pitch; x++) 406 | fprintf(c, "0x%02x, ", (unsigned char)bitmap->buffer[y * bitmap->pitch + x]); 407 | fprintf(c, "\n"); 408 | } 409 | } 410 | } 411 | fprintf(c, "};\n\n"); 412 | } else { 413 | strcpy(bname, "NULL"); 414 | } 415 | } 416 | 417 | void store_glyph(FT_Face *face, FT_GlyphSlotRec *glyph, 418 | wchar_t ch, int size, char *name, 419 | FILE *c, char **post, int *post_len, int *post_count, 420 | int with_kerning, wchar_t *char_list, int compress, int rotate, int mono) 421 | { 422 | FT_Bitmap *bitmap = &glyph->bitmap; 423 | 424 | // Work out a name for this glyph 425 | int len = strlen(name) + 24; 426 | char *bname = malloc(len); 427 | char *gname = malloc(len); 428 | char *kname = malloc(len); 429 | 430 | snprintf(bname, len, "bitmap_%s_%d_%04x", name, size, ch); 431 | snprintf(gname, len, "glyph_%s_%d_%04x", name, size, ch); 432 | snprintf(kname, len, "kerning_%s_%d_%04x", name, size, ch); 433 | 434 | // Generate the bitmap 435 | store_bitmap(c, bitmap, bname, ch, compress, rotate, mono); 436 | 437 | // Generate the kerning table 438 | if (with_kerning) { 439 | fprintf(c, "/** Kerning table for character '%s'. */\n", mb(ch)); 440 | fprintf(c, "static const struct kerning %s[] %s= {\n", kname, get_section(kname)); 441 | wchar_t *a = char_list; 442 | while (*a) { 443 | FT_Vector kern; 444 | FT_Get_Kerning(*face, *a, ch, FT_KERNING_DEFAULT, &kern); 445 | if (kern.x) 446 | fprintf(c, "\t{ /* .left = '%s' */ %u, /* .offset = */ %d },\n", 447 | mb(*a), *a, (int)kern.x / 64); 448 | a++; 449 | } 450 | fprintf(c, "\t{ /* .left = */ 0, /* .offset = */ 0 },\n"); 451 | fprintf(c, "};\n\n"); 452 | } else { 453 | free(kname); 454 | kname = strdup("NULL"); 455 | } 456 | 457 | fprintf(c, "/** Glyph definition for character '%s'. */\n", mb(ch)); 458 | fprintf(c, "static const struct glyph %s %s= {\n", gname, get_section(gname)); 459 | fprintf(c, "\t.glyph = %u,\n", ch); 460 | fprintf(c, "\t.left = %d,\n", glyph->bitmap_left); 461 | fprintf(c, "\t.top = %d,\n", glyph->bitmap_top); 462 | fprintf(c, "\t.advance = %d,\n", (int)glyph->advance.x / 64); 463 | fprintf(c, "\t.cols = %d,\n", bitmap->width); 464 | fprintf(c, "\t.rows = %d,\n", bitmap->rows); 465 | fprintf(c, "\t.bitmap = %s,\n", bname); 466 | fprintf(c, "\t.kerning = %s,\n", kname); 467 | fprintf(c, "};\n\n"); 468 | 469 | // Append to the post 470 | char *str = malloc(len + 100); 471 | snprintf(str, len + 100, "\t&%s, /* U+%04X '%s' */\n", gname, ch, mb(ch)); 472 | *post = realloc(*post, (*post_len) + strlen(str) + 1); 473 | strcpy((*post) + (*post_len), str); 474 | (*post_len) += strlen(str); 475 | (*post_count)++; 476 | 477 | free(str); 478 | free(bname); 479 | free(gname); 480 | free(kname); 481 | } 482 | 483 | char *get_section(char *name) 484 | { 485 | static char str[512]; 486 | static int count = 0; 487 | 488 | if (section == NULL) return ""; 489 | snprintf(str, 512, "__attribute__ ((section (\"%s.%s_%04x\"))) ", section, name, count++); 490 | return str; 491 | } 492 | 493 | int cmp_wchar(const void *p1, const void *p2) 494 | { 495 | return *(wchar_t *)p1 - *(wchar_t *)p2; 496 | } 497 | 498 | // vim: set softtabstop=8 shiftwidth=8 tabstop=8: 499 | -------------------------------------------------------------------------------- /examples/font-ubuntumono-10.c: -------------------------------------------------------------------------------- 1 | /* AUTOMATICALLY GENERATED FILE! EDITING NOT RECOMMENDED! 2 | * 3 | * This file is distributed under the terms of the MIT License. 4 | * See the LICENSE file at the top of this tree, or if it is missing a copy can 5 | * be found at http://opensource.org/licenses/MIT 6 | */ 7 | 8 | #include 9 | #include "fontem.h" 10 | #include "font-UbuntuMonoB-10.h" 11 | 12 | static unsigned char bitmap_UbuntuMonoB_10_0021[] = { /* '!' */ 13 | 0xff, 14 | 0xff, 15 | 0xf5, 16 | 0xcf, 17 | 0x00, 18 | 0xb6, 19 | }; 20 | 21 | static struct glyph glyph_UbuntuMonoB_10_0021 = { /* '!' */ 22 | .left = 2, 23 | .top = 6, 24 | .cols = 1, 25 | .rows = 6, 26 | .bitmap = bitmap_UbuntuMonoB_10_0021, 27 | }; 28 | 29 | static unsigned char bitmap_UbuntuMonoB_10_0040[] = { /* '@' */ 30 | 0x10, 0xac, 0xf0, 0xde, 0x47, 31 | 0x9b, 0xa9, 0x12, 0x35, 0xdb, 32 | 0xe9, 0x20, 0x99, 0xf7, 0xfe, 33 | 0xfc, 0x04, 0xf6, 0x23, 0xff, 34 | 0xea, 0x1b, 0x8c, 0x15, 0xff, 35 | 0xa1, 0x9c, 0x13, 0x00, 0x47, 36 | 0x14, 0xac, 0xf2, 0xe9, 0x00, 37 | }; 38 | 39 | static struct glyph glyph_UbuntuMonoB_10_0040 = { /* '@' */ 40 | .left = 0, 41 | .top = 6, 42 | .cols = 5, 43 | .rows = 7, 44 | .bitmap = bitmap_UbuntuMonoB_10_0040, 45 | }; 46 | 47 | static unsigned char bitmap_UbuntuMonoB_10_0023[] = { /* '#' */ 48 | 0x00, 0x20, 0xe0, 0x20, 0xe0, 49 | 0xff, 0xff, 0xff, 0xff, 0xff, 50 | 0x00, 0x82, 0x7e, 0x80, 0x7e, 51 | 0xff, 0xff, 0xff, 0xff, 0xff, 52 | 0x00, 0xd0, 0x2d, 0xd0, 0x30, 53 | 0x00, 0xf0, 0x0f, 0xf0, 0x10, 54 | }; 55 | 56 | static struct glyph glyph_UbuntuMonoB_10_0023 = { /* '#' */ 57 | .left = 0, 58 | .top = 6, 59 | .cols = 5, 60 | .rows = 6, 61 | .bitmap = bitmap_UbuntuMonoB_10_0023, 62 | }; 63 | 64 | static unsigned char bitmap_UbuntuMonoB_10_0024[] = { /* '$' */ 65 | 0x00, 0x00, 0xff, 0x01, 66 | 0x51, 0xdb, 0xff, 0xd4, 67 | 0xef, 0x26, 0x0e, 0x2a, 68 | 0xb6, 0xd4, 0x6a, 0x06, 69 | 0x04, 0x59, 0xc4, 0xb8, 70 | 0x34, 0x12, 0x24, 0xf6, 71 | 0xac, 0xf1, 0xff, 0x8f, 72 | 0x00, 0x00, 0xff, 0x00, 73 | }; 74 | 75 | static struct glyph glyph_UbuntuMonoB_10_0024 = { /* '$' */ 76 | .left = 0, 77 | .top = 7, 78 | .cols = 4, 79 | .rows = 8, 80 | .bitmap = bitmap_UbuntuMonoB_10_0024, 81 | }; 82 | 83 | static unsigned char bitmap_UbuntuMonoB_10_0025[] = { /* '%' */ 84 | 0xb6, 0xb6, 0x40, 0xc0, 0x00, 85 | 0xf9, 0x3d, 0xc0, 0x40, 0x00, 86 | 0xb8, 0xf7, 0xc0, 0x00, 0x00, 87 | 0x00, 0xc0, 0x40, 0xb6, 0xb6, 88 | 0x40, 0xc0, 0x00, 0x86, 0xf9, 89 | 0xc0, 0x40, 0x00, 0xb8, 0xb7, 90 | }; 91 | 92 | static struct glyph glyph_UbuntuMonoB_10_0025 = { /* '%' */ 93 | .left = 0, 94 | .top = 6, 95 | .cols = 5, 96 | .rows = 6, 97 | .bitmap = bitmap_UbuntuMonoB_10_0025, 98 | }; 99 | 100 | static unsigned char bitmap_UbuntuMonoB_10_005e[] = { /* '^' */ 101 | 0x00, 0x5f, 0xff, 0x65, 0x00, 102 | 0x23, 0xf0, 0x66, 0xf2, 0x2a, 103 | 0x81, 0x8f, 0x00, 0x87, 0x8d, 104 | }; 105 | 106 | static struct glyph glyph_UbuntuMonoB_10_005e = { /* '^' */ 107 | .left = 0, 108 | .top = 6, 109 | .cols = 5, 110 | .rows = 3, 111 | .bitmap = bitmap_UbuntuMonoB_10_005e, 112 | }; 113 | 114 | static unsigned char bitmap_UbuntuMonoB_10_0026[] = { /* '&' */ 115 | 0x7d, 0xed, 0xf2, 0x90, 0x00, 116 | 0xe4, 0x4e, 0x4e, 0xd6, 0x00, 117 | 0x4f, 0xff, 0xc9, 0x1c, 0x5a, 118 | 0xd6, 0x51, 0xeb, 0xbd, 0x63, 119 | 0xef, 0x30, 0x7f, 0xff, 0x20, 120 | 0x5c, 0xe7, 0xf1, 0xad, 0x86, 121 | }; 122 | 123 | static struct glyph glyph_UbuntuMonoB_10_0026 = { /* '&' */ 124 | .left = 0, 125 | .top = 6, 126 | .cols = 5, 127 | .rows = 6, 128 | .bitmap = bitmap_UbuntuMonoB_10_0026, 129 | }; 130 | 131 | static unsigned char bitmap_UbuntuMonoB_10_002a[] = { /* '*' */ 132 | 0x00, 0x00, 0xff, 0x00, 0x00, 133 | 0xba, 0x64, 0xff, 0x60, 0xb9, 134 | 0x47, 0xf2, 0xff, 0xef, 0x43, 135 | 0x2e, 0xc0, 0xd4, 0xc0, 0x2f, 136 | 0x9c, 0x80, 0x02, 0x81, 0x9b, 137 | }; 138 | 139 | static struct glyph glyph_UbuntuMonoB_10_002a = { /* '*' */ 140 | .left = 0, 141 | .top = 6, 142 | .cols = 5, 143 | .rows = 5, 144 | .bitmap = bitmap_UbuntuMonoB_10_002a, 145 | }; 146 | 147 | static unsigned char bitmap_UbuntuMonoB_10_0028[] = { /* '(' */ 148 | 0x00, 0x3e, 0xa5, 149 | 0x22, 0xf1, 0x67, 150 | 0x9b, 0x93, 0x00, 151 | 0xe1, 0x2b, 0x00, 152 | 0xf9, 0x07, 0x00, 153 | 0xe4, 0x1a, 0x00, 154 | 0xa0, 0x6a, 0x00, 155 | 0x27, 0xe4, 0x2e, 156 | 0x00, 0x41, 0xac, 157 | }; 158 | 159 | static struct glyph glyph_UbuntuMonoB_10_0028 = { /* '(' */ 160 | .left = 1, 161 | .top = 7, 162 | .cols = 3, 163 | .rows = 9, 164 | .bitmap = bitmap_UbuntuMonoB_10_0028, 165 | }; 166 | 167 | static unsigned char bitmap_UbuntuMonoB_10_0029[] = { /* ')' */ 168 | 0xa5, 0x3e, 0x00, 169 | 0x68, 0xf0, 0x20, 170 | 0x00, 0x97, 0x97, 171 | 0x00, 0x2c, 0xe0, 172 | 0x00, 0x08, 0xf8, 173 | 0x00, 0x19, 0xe4, 174 | 0x00, 0x68, 0x9f, 175 | 0x29, 0xe3, 0x27, 176 | 0xa4, 0x46, 0x00, 177 | }; 178 | 179 | static struct glyph glyph_UbuntuMonoB_10_0029 = { /* ')' */ 180 | .left = 1, 181 | .top = 7, 182 | .cols = 3, 183 | .rows = 9, 184 | .bitmap = bitmap_UbuntuMonoB_10_0029, 185 | }; 186 | 187 | static unsigned char bitmap_UbuntuMonoB_10_005f[] = { /* '_' */ 188 | 0xff, 0xff, 0xff, 0xff, 0xff, 189 | }; 190 | 191 | static struct glyph glyph_UbuntuMonoB_10_005f = { /* '_' */ 192 | .left = 0, 193 | .top = -1, 194 | .cols = 5, 195 | .rows = 1, 196 | .bitmap = bitmap_UbuntuMonoB_10_005f, 197 | }; 198 | 199 | static unsigned char bitmap_UbuntuMonoB_10_002b[] = { /* '+' */ 200 | 0x00, 0x00, 0xff, 0x00, 0x00, 201 | 0x00, 0x00, 0xff, 0x00, 0x00, 202 | 0xff, 0xff, 0xff, 0xff, 0xff, 203 | 0x00, 0x00, 0xff, 0x00, 0x00, 204 | 0x00, 0x00, 0xff, 0x00, 0x00, 205 | }; 206 | 207 | static struct glyph glyph_UbuntuMonoB_10_002b = { /* '+' */ 208 | .left = 0, 209 | .top = 5, 210 | .cols = 5, 211 | .rows = 5, 212 | .bitmap = bitmap_UbuntuMonoB_10_002b, 213 | }; 214 | 215 | static unsigned char bitmap_UbuntuMonoB_10_002d[] = { /* '-' */ 216 | 0xff, 0xff, 0xff, 217 | }; 218 | 219 | static struct glyph glyph_UbuntuMonoB_10_002d = { /* '-' */ 220 | .left = 1, 221 | .top = 3, 222 | .cols = 3, 223 | .rows = 1, 224 | .bitmap = bitmap_UbuntuMonoB_10_002d, 225 | }; 226 | 227 | static unsigned char bitmap_UbuntuMonoB_10_003d[] = { /* '=' */ 228 | 0xff, 0xff, 0xff, 0xff, 229 | 0x00, 0x00, 0x00, 0x00, 230 | 0xff, 0xff, 0xff, 0xff, 231 | }; 232 | 233 | static struct glyph glyph_UbuntuMonoB_10_003d = { /* '=' */ 234 | .left = 0, 235 | .top = 4, 236 | .cols = 4, 237 | .rows = 3, 238 | .bitmap = bitmap_UbuntuMonoB_10_003d, 239 | }; 240 | 241 | static unsigned char bitmap_UbuntuMonoB_10_007b[] = { /* '{' */ 242 | 0x00, 0xaf, 0xfe, 243 | 0x00, 0xfb, 0x0f, 244 | 0x00, 0xff, 0x00, 245 | 0x1c, 0xf1, 0x00, 246 | 0xff, 0x96, 0x00, 247 | 0x1d, 0xf2, 0x00, 248 | 0x00, 0xff, 0x00, 249 | 0x00, 0xfb, 0x11, 250 | 0x00, 0xaf, 0xff, 251 | }; 252 | 253 | static struct glyph glyph_UbuntuMonoB_10_007b = { /* '{' */ 254 | .left = 1, 255 | .top = 7, 256 | .cols = 3, 257 | .rows = 9, 258 | .bitmap = bitmap_UbuntuMonoB_10_007b, 259 | }; 260 | 261 | static unsigned char bitmap_UbuntuMonoB_10_007d[] = { /* '}' */ 262 | 0xfe, 0xae, 0x00, 263 | 0x0f, 0xfb, 0x00, 264 | 0x00, 0xff, 0x00, 265 | 0x00, 0xf2, 0x1a, 266 | 0x00, 0x8e, 0xff, 267 | 0x00, 0xf1, 0x1b, 268 | 0x00, 0xff, 0x00, 269 | 0x11, 0xfb, 0x00, 270 | 0xff, 0xb0, 0x00, 271 | }; 272 | 273 | static struct glyph glyph_UbuntuMonoB_10_007d = { /* '}' */ 274 | .left = 1, 275 | .top = 7, 276 | .cols = 3, 277 | .rows = 9, 278 | .bitmap = bitmap_UbuntuMonoB_10_007d, 279 | }; 280 | 281 | static unsigned char bitmap_UbuntuMonoB_10_007c[] = { /* '|' */ 282 | 0xff, 283 | 0xff, 284 | 0xff, 285 | 0xff, 286 | 0xff, 287 | 0xff, 288 | 0xff, 289 | 0xff, 290 | 0xff, 291 | }; 292 | 293 | static struct glyph glyph_UbuntuMonoB_10_007c = { /* '|' */ 294 | .left = 2, 295 | .top = 7, 296 | .cols = 1, 297 | .rows = 9, 298 | .bitmap = bitmap_UbuntuMonoB_10_007c, 299 | }; 300 | 301 | static unsigned char bitmap_UbuntuMonoB_10_005b[] = { /* '[' */ 302 | 0xff, 0xff, 0xff, 303 | 0xff, 0x00, 0x00, 304 | 0xff, 0x00, 0x00, 305 | 0xff, 0x00, 0x00, 306 | 0xff, 0x00, 0x00, 307 | 0xff, 0x00, 0x00, 308 | 0xff, 0x00, 0x00, 309 | 0xff, 0x00, 0x00, 310 | 0xff, 0xff, 0xff, 311 | }; 312 | 313 | static struct glyph glyph_UbuntuMonoB_10_005b = { /* '[' */ 314 | .left = 1, 315 | .top = 7, 316 | .cols = 3, 317 | .rows = 9, 318 | .bitmap = bitmap_UbuntuMonoB_10_005b, 319 | }; 320 | 321 | static unsigned char bitmap_UbuntuMonoB_10_005d[] = { /* ']' */ 322 | 0xff, 0xff, 0xff, 323 | 0x00, 0x00, 0xff, 324 | 0x00, 0x00, 0xff, 325 | 0x00, 0x00, 0xff, 326 | 0x00, 0x00, 0xff, 327 | 0x00, 0x00, 0xff, 328 | 0x00, 0x00, 0xff, 329 | 0x00, 0x00, 0xff, 330 | 0xff, 0xff, 0xff, 331 | }; 332 | 333 | static struct glyph glyph_UbuntuMonoB_10_005d = { /* ']' */ 334 | .left = 1, 335 | .top = 7, 336 | .cols = 3, 337 | .rows = 9, 338 | .bitmap = bitmap_UbuntuMonoB_10_005d, 339 | }; 340 | 341 | static unsigned char bitmap_UbuntuMonoB_10_005c[] = { /* '\' */ 342 | 0xc7, 0x38, 0x00, 0x00, 0x00, 343 | 0x56, 0xaa, 0x00, 0x00, 0x00, 344 | 0x03, 0xdc, 0x1f, 0x00, 0x00, 345 | 0x00, 0x72, 0x8e, 0x00, 0x00, 346 | 0x00, 0x0e, 0xe3, 0x0d, 0x00, 347 | 0x00, 0x00, 0x8f, 0x71, 0x00, 348 | 0x00, 0x00, 0x20, 0xdc, 0x03, 349 | 0x00, 0x00, 0x00, 0xab, 0x55, 350 | 0x00, 0x00, 0x00, 0x39, 0xc7, 351 | }; 352 | 353 | static struct glyph glyph_UbuntuMonoB_10_005c = { /* '\' */ 354 | .left = 0, 355 | .top = 7, 356 | .cols = 5, 357 | .rows = 9, 358 | .bitmap = bitmap_UbuntuMonoB_10_005c, 359 | }; 360 | 361 | static unsigned char bitmap_UbuntuMonoB_10_003a[] = { /* ':' */ 362 | 0xc6, 0xc6, 363 | 0xc6, 0xc7, 364 | 0x00, 0x00, 365 | 0xc6, 0xc6, 366 | 0xc6, 0xc7, 367 | }; 368 | 369 | static struct glyph glyph_UbuntuMonoB_10_003a = { /* ':' */ 370 | .left = 2, 371 | .top = 5, 372 | .cols = 2, 373 | .rows = 5, 374 | .bitmap = bitmap_UbuntuMonoB_10_003a, 375 | }; 376 | 377 | static unsigned char bitmap_UbuntuMonoB_10_0022[] = { /* '"' */ 378 | 0xfe, 0x00, 0xfe, 379 | 0xe4, 0x00, 0xe4, 380 | 0xab, 0x00, 0xac, 381 | }; 382 | 383 | static struct glyph glyph_UbuntuMonoB_10_0022 = { /* '"' */ 384 | .left = 0, 385 | .top = 7, 386 | .cols = 3, 387 | .rows = 3, 388 | .bitmap = bitmap_UbuntuMonoB_10_0022, 389 | }; 390 | 391 | static unsigned char bitmap_UbuntuMonoB_10_003b[] = { /* ';' */ 392 | 0x00, 0xc6, 0xc6, 393 | 0x00, 0xc6, 0xc7, 394 | 0x00, 0x00, 0x00, 395 | 0x00, 0xc7, 0xbc, 396 | 0x00, 0xff, 0xf2, 397 | 0x4a, 0xff, 0xa4, 398 | 0xd4, 0x98, 0x0b, 399 | }; 400 | 401 | static struct glyph glyph_UbuntuMonoB_10_003b = { /* ';' */ 402 | .left = 1, 403 | .top = 5, 404 | .cols = 3, 405 | .rows = 7, 406 | .bitmap = bitmap_UbuntuMonoB_10_003b, 407 | }; 408 | 409 | static unsigned char bitmap_UbuntuMonoB_10_0027[] = { /* ''' */ 410 | 0xff, 411 | 0xe7, 412 | 0xae, 413 | }; 414 | 415 | static struct glyph glyph_UbuntuMonoB_10_0027 = { /* ''' */ 416 | .left = 1, 417 | .top = 7, 418 | .cols = 1, 419 | .rows = 3, 420 | .bitmap = bitmap_UbuntuMonoB_10_0027, 421 | }; 422 | 423 | static unsigned char bitmap_UbuntuMonoB_10_003c[] = { /* '<' */ 424 | 0x00, 0x00, 0x1d, 0x98, 425 | 0x00, 0x40, 0xea, 0xe8, 426 | 0x57, 0xfb, 0xd1, 0x27, 427 | 0x8c, 0xe5, 0x10, 0x00, 428 | 0x55, 0xfb, 0xd0, 0x27, 429 | 0x00, 0x3f, 0xe9, 0xe8, 430 | 0x00, 0x00, 0x1d, 0x98, 431 | }; 432 | 433 | static struct glyph glyph_UbuntuMonoB_10_003c = { /* '<' */ 434 | .left = 0, 435 | .top = 7, 436 | .cols = 4, 437 | .rows = 7, 438 | .bitmap = bitmap_UbuntuMonoB_10_003c, 439 | }; 440 | 441 | static unsigned char bitmap_UbuntuMonoB_10_003e[] = { /* '>' */ 442 | 0x9b, 0x31, 0x00, 0x00, 443 | 0xe5, 0xf9, 0x76, 0x02, 444 | 0x1e, 0xb8, 0xff, 0xbf, 445 | 0x00, 0x00, 0xb0, 0xff, 446 | 0x1d, 0xb7, 0xff, 0xbc, 447 | 0xe5, 0xf9, 0x75, 0x01, 448 | 0x9b, 0x31, 0x00, 0x00, 449 | }; 450 | 451 | static struct glyph glyph_UbuntuMonoB_10_003e = { /* '>' */ 452 | .left = 0, 453 | .top = 7, 454 | .cols = 4, 455 | .rows = 7, 456 | .bitmap = bitmap_UbuntuMonoB_10_003e, 457 | }; 458 | 459 | static unsigned char bitmap_UbuntuMonoB_10_003f[] = { /* '?' */ 460 | 0xb9, 0xf3, 0x8b, 461 | 0x28, 0x25, 0xf6, 462 | 0x00, 0x78, 0xb6, 463 | 0x00, 0xee, 0x27, 464 | 0x00, 0x00, 0x00, 465 | 0x00, 0xc4, 0x00, 466 | }; 467 | 468 | static struct glyph glyph_UbuntuMonoB_10_003f = { /* '?' */ 469 | .left = 1, 470 | .top = 6, 471 | .cols = 3, 472 | .rows = 6, 473 | .bitmap = bitmap_UbuntuMonoB_10_003f, 474 | }; 475 | 476 | static unsigned char bitmap_UbuntuMonoB_10_002c[] = { /* ',' */ 477 | 0x00, 0xc7, 0xbc, 478 | 0x00, 0xff, 0xf2, 479 | 0x4a, 0xff, 0xa4, 480 | 0xd4, 0x98, 0x0b, 481 | }; 482 | 483 | static struct glyph glyph_UbuntuMonoB_10_002c = { /* ',' */ 484 | .left = 1, 485 | .top = 2, 486 | .cols = 3, 487 | .rows = 4, 488 | .bitmap = bitmap_UbuntuMonoB_10_002c, 489 | }; 490 | 491 | static unsigned char bitmap_UbuntuMonoB_10_002e[] = { /* '.' */ 492 | 0xc6, 0xc6, 493 | 0xc6, 0xc7, 494 | }; 495 | 496 | static struct glyph glyph_UbuntuMonoB_10_002e = { /* '.' */ 497 | .left = 2, 498 | .top = 2, 499 | .cols = 2, 500 | .rows = 2, 501 | .bitmap = bitmap_UbuntuMonoB_10_002e, 502 | }; 503 | 504 | static unsigned char bitmap_UbuntuMonoB_10_002f[] = { /* '/' */ 505 | 0x00, 0x00, 0x00, 0x32, 0xcd, 506 | 0x00, 0x00, 0x00, 0x97, 0x69, 507 | 0x00, 0x00, 0x0a, 0xe6, 0x0f, 508 | 0x00, 0x00, 0x60, 0xa0, 0x00, 509 | 0x00, 0x00, 0xc4, 0x3b, 0x00, 510 | 0x00, 0x29, 0xd6, 0x00, 0x00, 511 | 0x00, 0x8d, 0x72, 0x00, 0x00, 512 | 0x06, 0xe5, 0x14, 0x00, 0x00, 513 | 0x56, 0xaa, 0x00, 0x00, 0x00, 514 | }; 515 | 516 | static struct glyph glyph_UbuntuMonoB_10_002f = { /* '/' */ 517 | .left = 0, 518 | .top = 7, 519 | .cols = 5, 520 | .rows = 9, 521 | .bitmap = bitmap_UbuntuMonoB_10_002f, 522 | }; 523 | 524 | static unsigned char bitmap_UbuntuMonoB_10_0060[] = { /* '`' */ 525 | 0x9e, 0x38, 526 | 0x5b, 0xb5, 527 | }; 528 | 529 | static struct glyph glyph_UbuntuMonoB_10_0060 = { /* '`' */ 530 | .left = 2, 531 | .top = 7, 532 | .cols = 2, 533 | .rows = 2, 534 | .bitmap = bitmap_UbuntuMonoB_10_0060, 535 | }; 536 | 537 | static unsigned char bitmap_UbuntuMonoB_10_007e[] = { /* '~' */ 538 | 0x6d, 0xed, 0x85, 0x2d, 0xcb, 539 | 0xcb, 0x2b, 0x89, 0xee, 0x69, 540 | }; 541 | 542 | static struct glyph glyph_UbuntuMonoB_10_007e = { /* '~' */ 543 | .left = 0, 544 | .top = 4, 545 | .cols = 5, 546 | .rows = 2, 547 | .bitmap = bitmap_UbuntuMonoB_10_007e, 548 | }; 549 | 550 | static struct glyph glyph_UbuntuMonoB_10_0020 = { /* ' ' */ 551 | .left = 0, 552 | .top = 0, 553 | .cols = 0, 554 | .rows = 0, 555 | .bitmap = NULL, 556 | }; 557 | 558 | static unsigned char bitmap_UbuntuMonoB_10_0041[] = { /* 'A' */ 559 | 0x00, 0x47, 0xff, 0x68, 0x00, 560 | 0x00, 0x9e, 0xdb, 0xba, 0x00, 561 | 0x05, 0xef, 0x63, 0xfa, 0x10, 562 | 0x47, 0xfb, 0x09, 0xf2, 0x53, 563 | 0x94, 0xff, 0xff, 0xff, 0x98, 564 | 0xdc, 0x8a, 0x00, 0x7e, 0xdd, 565 | }; 566 | 567 | static struct glyph glyph_UbuntuMonoB_10_0041 = { /* 'A' */ 568 | .left = 0, 569 | .top = 6, 570 | .cols = 5, 571 | .rows = 6, 572 | .bitmap = bitmap_UbuntuMonoB_10_0041, 573 | }; 574 | 575 | static unsigned char bitmap_UbuntuMonoB_10_0042[] = { /* 'B' */ 576 | 0xea, 0xfb, 0xec, 0x7c, 577 | 0xff, 0x04, 0x3e, 0xeb, 578 | 0xff, 0xff, 0xff, 0x8d, 579 | 0xff, 0x01, 0x42, 0xf0, 580 | 0xff, 0x02, 0x3e, 0xe6, 581 | 0xe8, 0xfc, 0xe2, 0x55, 582 | }; 583 | 584 | static struct glyph glyph_UbuntuMonoB_10_0042 = { /* 'B' */ 585 | .left = 0, 586 | .top = 6, 587 | .cols = 4, 588 | .rows = 6, 589 | .bitmap = bitmap_UbuntuMonoB_10_0042, 590 | }; 591 | 592 | static unsigned char bitmap_UbuntuMonoB_10_0043[] = { /* 'C' */ 593 | 0x18, 0xb7, 0xf8, 0xd6, 594 | 0xaa, 0x7c, 0x04, 0x00, 595 | 0xed, 0x10, 0x00, 0x00, 596 | 0xf0, 0x0e, 0x00, 0x00, 597 | 0xb7, 0x76, 0x05, 0x00, 598 | 0x25, 0xc8, 0xfb, 0xd8, 599 | }; 600 | 601 | static struct glyph glyph_UbuntuMonoB_10_0043 = { /* 'C' */ 602 | .left = 0, 603 | .top = 6, 604 | .cols = 4, 605 | .rows = 6, 606 | .bitmap = bitmap_UbuntuMonoB_10_0043, 607 | }; 608 | 609 | static unsigned char bitmap_UbuntuMonoB_10_0044[] = { /* 'D' */ 610 | 0xed, 0xf7, 0xc0, 0x22, 611 | 0xff, 0x0a, 0x81, 0xb4, 612 | 0xff, 0x00, 0x0f, 0xee, 613 | 0xff, 0x00, 0x11, 0xec, 614 | 0xff, 0x0d, 0x8c, 0xaf, 615 | 0xef, 0xf6, 0xba, 0x1c, 616 | }; 617 | 618 | static struct glyph glyph_UbuntuMonoB_10_0044 = { /* 'D' */ 619 | .left = 0, 620 | .top = 6, 621 | .cols = 4, 622 | .rows = 6, 623 | .bitmap = bitmap_UbuntuMonoB_10_0044, 624 | }; 625 | 626 | static unsigned char bitmap_UbuntuMonoB_10_0045[] = { /* 'E' */ 627 | 0xff, 0xff, 0xff, 0xff, 628 | 0xff, 0x00, 0x00, 0x00, 629 | 0xff, 0xff, 0xff, 0x00, 630 | 0xff, 0x00, 0x00, 0x00, 631 | 0xff, 0x00, 0x00, 0x00, 632 | 0xff, 0xff, 0xff, 0xff, 633 | }; 634 | 635 | static struct glyph glyph_UbuntuMonoB_10_0045 = { /* 'E' */ 636 | .left = 1, 637 | .top = 6, 638 | .cols = 4, 639 | .rows = 6, 640 | .bitmap = bitmap_UbuntuMonoB_10_0045, 641 | }; 642 | 643 | static unsigned char bitmap_UbuntuMonoB_10_0046[] = { /* 'F' */ 644 | 0xff, 0xff, 0xff, 645 | 0xff, 0x00, 0x00, 646 | 0xff, 0xff, 0xff, 647 | 0xff, 0x00, 0x00, 648 | 0xff, 0x00, 0x00, 649 | 0xff, 0x00, 0x00, 650 | }; 651 | 652 | static struct glyph glyph_UbuntuMonoB_10_0046 = { /* 'F' */ 653 | .left = 1, 654 | .top = 6, 655 | .cols = 3, 656 | .rows = 6, 657 | .bitmap = bitmap_UbuntuMonoB_10_0046, 658 | }; 659 | 660 | static unsigned char bitmap_UbuntuMonoB_10_0047[] = { /* 'G' */ 661 | 0x1c, 0xbf, 0xfa, 0xd8, 0x00, 662 | 0xad, 0x7f, 0x07, 0x00, 0x00, 663 | 0xed, 0x0e, 0x00, 0x00, 0x00, 664 | 0xec, 0x14, 0x00, 0x00, 0xff, 665 | 0xa7, 0xa2, 0x1a, 0x02, 0xff, 666 | 0x15, 0xaa, 0xef, 0xff, 0xff, 667 | }; 668 | 669 | static struct glyph glyph_UbuntuMonoB_10_0047 = { /* 'G' */ 670 | .left = 0, 671 | .top = 6, 672 | .cols = 5, 673 | .rows = 6, 674 | .bitmap = bitmap_UbuntuMonoB_10_0047, 675 | }; 676 | 677 | static unsigned char bitmap_UbuntuMonoB_10_0048[] = { /* 'H' */ 678 | 0xff, 0x00, 0x00, 0xff, 679 | 0xff, 0x00, 0x00, 0xff, 680 | 0xff, 0xff, 0xff, 0xff, 681 | 0xff, 0x00, 0x00, 0xff, 682 | 0xff, 0x00, 0x00, 0xff, 683 | 0xff, 0x00, 0x00, 0xff, 684 | }; 685 | 686 | static struct glyph glyph_UbuntuMonoB_10_0048 = { /* 'H' */ 687 | .left = 0, 688 | .top = 6, 689 | .cols = 4, 690 | .rows = 6, 691 | .bitmap = bitmap_UbuntuMonoB_10_0048, 692 | }; 693 | 694 | static unsigned char bitmap_UbuntuMonoB_10_0049[] = { /* 'I' */ 695 | 0xff, 0xff, 0xff, 696 | 0x00, 0xff, 0x00, 697 | 0x00, 0xff, 0x00, 698 | 0x00, 0xff, 0x00, 699 | 0x00, 0xff, 0x00, 700 | 0xff, 0xff, 0xff, 701 | }; 702 | 703 | static struct glyph glyph_UbuntuMonoB_10_0049 = { /* 'I' */ 704 | .left = 0, 705 | .top = 6, 706 | .cols = 3, 707 | .rows = 6, 708 | .bitmap = bitmap_UbuntuMonoB_10_0049, 709 | }; 710 | 711 | static unsigned char bitmap_UbuntuMonoB_10_004a[] = { /* 'J' */ 712 | 0x00, 0xff, 0xff, 0xff, 713 | 0x00, 0x00, 0x00, 0xff, 714 | 0x00, 0x00, 0x00, 0xff, 715 | 0x00, 0x00, 0x00, 0xff, 716 | 0x00, 0x01, 0x44, 0xe4, 717 | 0xa6, 0xf8, 0xe2, 0x51, 718 | }; 719 | 720 | static struct glyph glyph_UbuntuMonoB_10_004a = { /* 'J' */ 721 | .left = 0, 722 | .top = 6, 723 | .cols = 4, 724 | .rows = 6, 725 | .bitmap = bitmap_UbuntuMonoB_10_004a, 726 | }; 727 | 728 | static unsigned char bitmap_UbuntuMonoB_10_004b[] = { /* 'K' */ 729 | 0xff, 0x00, 0x00, 0x7d, 0x90, 730 | 0xff, 0x08, 0x9d, 0x91, 0x01, 731 | 0xff, 0xd5, 0x7b, 0x00, 0x00, 732 | 0xff, 0x91, 0xd7, 0x21, 0x00, 733 | 0xff, 0x00, 0x55, 0xdc, 0x17, 734 | 0xff, 0x00, 0x00, 0x5e, 0xb4, 735 | }; 736 | 737 | static struct glyph glyph_UbuntuMonoB_10_004b = { /* 'K' */ 738 | .left = 0, 739 | .top = 6, 740 | .cols = 5, 741 | .rows = 6, 742 | .bitmap = bitmap_UbuntuMonoB_10_004b, 743 | }; 744 | 745 | static unsigned char bitmap_UbuntuMonoB_10_004c[] = { /* 'L' */ 746 | 0xff, 0x00, 0x00, 0x00, 747 | 0xff, 0x00, 0x00, 0x00, 748 | 0xff, 0x00, 0x00, 0x00, 749 | 0xff, 0x00, 0x00, 0x00, 750 | 0xff, 0x00, 0x00, 0x00, 751 | 0xff, 0xff, 0xff, 0xff, 752 | }; 753 | 754 | static struct glyph glyph_UbuntuMonoB_10_004c = { /* 'L' */ 755 | .left = 0, 756 | .top = 6, 757 | .cols = 4, 758 | .rows = 6, 759 | .bitmap = bitmap_UbuntuMonoB_10_004c, 760 | }; 761 | 762 | static unsigned char bitmap_UbuntuMonoB_10_004d[] = { /* 'M' */ 763 | 0xb0, 0x45, 0x19, 0xff, 0x1e, 764 | 0xc6, 0xcf, 0x47, 0xee, 0x59, 765 | 0xd8, 0xe4, 0xcc, 0x9a, 0x8d, 766 | 0xe7, 0x5f, 0xff, 0x40, 0xb8, 767 | 0xf0, 0x15, 0x00, 0x0f, 0xda, 768 | 0xfb, 0x07, 0x00, 0x05, 0xf4, 769 | }; 770 | 771 | static struct glyph glyph_UbuntuMonoB_10_004d = { /* 'M' */ 772 | .left = 0, 773 | .top = 6, 774 | .cols = 5, 775 | .rows = 6, 776 | .bitmap = bitmap_UbuntuMonoB_10_004d, 777 | }; 778 | 779 | static unsigned char bitmap_UbuntuMonoB_10_004e[] = { /* 'N' */ 780 | 0xfd, 0x38, 0x00, 0xff, 781 | 0xff, 0xce, 0x02, 0xff, 782 | 0xff, 0xba, 0x5f, 0xff, 783 | 0xff, 0x2e, 0xdd, 0xff, 784 | 0xff, 0x00, 0xa2, 0xff, 785 | 0xff, 0x00, 0x26, 0xfc, 786 | }; 787 | 788 | static struct glyph glyph_UbuntuMonoB_10_004e = { /* 'N' */ 789 | .left = 0, 790 | .top = 6, 791 | .cols = 4, 792 | .rows = 6, 793 | .bitmap = bitmap_UbuntuMonoB_10_004e, 794 | }; 795 | 796 | static unsigned char bitmap_UbuntuMonoB_10_004f[] = { /* 'O' */ 797 | 0x23, 0xc2, 0xf4, 0xc5, 0x25, 798 | 0xb6, 0x71, 0x0d, 0x72, 0xb7, 799 | 0xf0, 0x09, 0x00, 0x0b, 0xf0, 800 | 0xf0, 0x09, 0x00, 0x0b, 0xef, 801 | 0xb9, 0x6f, 0x0c, 0x71, 0xb7, 802 | 0x26, 0xc6, 0xf5, 0xc6, 0x25, 803 | }; 804 | 805 | static struct glyph glyph_UbuntuMonoB_10_004f = { /* 'O' */ 806 | .left = 0, 807 | .top = 6, 808 | .cols = 5, 809 | .rows = 6, 810 | .bitmap = bitmap_UbuntuMonoB_10_004f, 811 | }; 812 | 813 | static unsigned char bitmap_UbuntuMonoB_10_0050[] = { /* 'P' */ 814 | 0xff, 0xfd, 0xdf, 0x56, 815 | 0xff, 0x03, 0x42, 0xe9, 816 | 0xff, 0x01, 0x40, 0xe6, 817 | 0xff, 0xfb, 0xd9, 0x4f, 818 | 0xff, 0x00, 0x00, 0x00, 819 | 0xff, 0x00, 0x00, 0x00, 820 | }; 821 | 822 | static struct glyph glyph_UbuntuMonoB_10_0050 = { /* 'P' */ 823 | .left = 0, 824 | .top = 6, 825 | .cols = 4, 826 | .rows = 6, 827 | .bitmap = bitmap_UbuntuMonoB_10_0050, 828 | }; 829 | 830 | static unsigned char bitmap_UbuntuMonoB_10_0051[] = { /* 'Q' */ 831 | 0x38, 0xe0, 0xe1, 0x3b, 832 | 0xc3, 0x4e, 0x52, 0xc5, 833 | 0xf3, 0x06, 0x08, 0xf2, 834 | 0xf5, 0x06, 0x06, 0xf4, 835 | 0xcb, 0x54, 0x4b, 0xc4, 836 | 0x45, 0xef, 0xe5, 0x39, 837 | 0x00, 0x59, 0xab, 0x23, 838 | 0x00, 0x02, 0x8b, 0xc2, 839 | }; 840 | 841 | static struct glyph glyph_UbuntuMonoB_10_0051 = { /* 'Q' */ 842 | .left = 0, 843 | .top = 6, 844 | .cols = 4, 845 | .rows = 8, 846 | .bitmap = bitmap_UbuntuMonoB_10_0051, 847 | }; 848 | 849 | static unsigned char bitmap_UbuntuMonoB_10_0052[] = { /* 'R' */ 850 | 0xff, 0xfd, 0xdb, 0x4b, 851 | 0xff, 0x04, 0x4a, 0xe3, 852 | 0xff, 0x04, 0x47, 0xe5, 853 | 0xff, 0xff, 0xe5, 0x39, 854 | 0xff, 0x06, 0xd1, 0x2f, 855 | 0xff, 0x00, 0x45, 0xbd, 856 | }; 857 | 858 | static struct glyph glyph_UbuntuMonoB_10_0052 = { /* 'R' */ 859 | .left = 0, 860 | .top = 6, 861 | .cols = 4, 862 | .rows = 6, 863 | .bitmap = bitmap_UbuntuMonoB_10_0052, 864 | }; 865 | 866 | static unsigned char bitmap_UbuntuMonoB_10_0053[] = { /* 'S' */ 867 | 0x5f, 0xe4, 0xf7, 0xae, 868 | 0xef, 0x28, 0x00, 0x00, 869 | 0xb6, 0xd2, 0x6f, 0x09, 870 | 0x03, 0x53, 0xbe, 0xb9, 871 | 0x00, 0x00, 0x27, 0xf0, 872 | 0xb5, 0xfb, 0xea, 0x6c, 873 | }; 874 | 875 | static struct glyph glyph_UbuntuMonoB_10_0053 = { /* 'S' */ 876 | .left = 0, 877 | .top = 6, 878 | .cols = 4, 879 | .rows = 6, 880 | .bitmap = bitmap_UbuntuMonoB_10_0053, 881 | }; 882 | 883 | static unsigned char bitmap_UbuntuMonoB_10_0054[] = { /* 'T' */ 884 | 0xff, 0xff, 0xff, 0xff, 0xff, 885 | 0x00, 0x00, 0xff, 0x00, 0x00, 886 | 0x00, 0x00, 0xff, 0x00, 0x00, 887 | 0x00, 0x00, 0xff, 0x00, 0x00, 888 | 0x00, 0x00, 0xff, 0x00, 0x00, 889 | 0x00, 0x00, 0xff, 0x00, 0x00, 890 | }; 891 | 892 | static struct glyph glyph_UbuntuMonoB_10_0054 = { /* 'T' */ 893 | .left = 0, 894 | .top = 6, 895 | .cols = 5, 896 | .rows = 6, 897 | .bitmap = bitmap_UbuntuMonoB_10_0054, 898 | }; 899 | 900 | static unsigned char bitmap_UbuntuMonoB_10_0055[] = { /* 'U' */ 901 | 0xff, 0x00, 0x00, 0xff, 902 | 0xff, 0x00, 0x00, 0xff, 903 | 0xff, 0x00, 0x00, 0xff, 904 | 0xff, 0x00, 0x01, 0xff, 905 | 0xe8, 0x2f, 0x31, 0xe7, 906 | 0x66, 0xeb, 0xea, 0x62, 907 | }; 908 | 909 | static struct glyph glyph_UbuntuMonoB_10_0055 = { /* 'U' */ 910 | .left = 0, 911 | .top = 6, 912 | .cols = 4, 913 | .rows = 6, 914 | .bitmap = bitmap_UbuntuMonoB_10_0055, 915 | }; 916 | 917 | static unsigned char bitmap_UbuntuMonoB_10_0056[] = { /* 'V' */ 918 | 0xe2, 0x7c, 0x00, 0x7c, 0xe1, 919 | 0x9f, 0xbb, 0x00, 0xc1, 0xa0, 920 | 0x56, 0xf9, 0x20, 0xfb, 0x59, 921 | 0x0e, 0xf9, 0xc5, 0xfa, 0x10, 922 | 0x00, 0xb5, 0xff, 0xb6, 0x00, 923 | 0x00, 0x5a, 0xff, 0x58, 0x00, 924 | }; 925 | 926 | static struct glyph glyph_UbuntuMonoB_10_0056 = { /* 'V' */ 927 | .left = 0, 928 | .top = 6, 929 | .cols = 5, 930 | .rows = 6, 931 | .bitmap = bitmap_UbuntuMonoB_10_0056, 932 | }; 933 | 934 | static unsigned char bitmap_UbuntuMonoB_10_0057[] = { /* 'W' */ 935 | 0xfc, 0x05, 0x00, 0x03, 0xfa, 936 | 0xf3, 0x0f, 0x00, 0x0d, 0xef, 937 | 0xe5, 0x39, 0xdf, 0x36, 0xe3, 938 | 0xd4, 0x97, 0xd7, 0x96, 0xd3, 939 | 0xc0, 0xe7, 0x2e, 0xe9, 0xc0, 940 | 0xa6, 0xb2, 0x00, 0xb5, 0xa8, 941 | }; 942 | 943 | static struct glyph glyph_UbuntuMonoB_10_0057 = { /* 'W' */ 944 | .left = 0, 945 | .top = 6, 946 | .cols = 5, 947 | .rows = 6, 948 | .bitmap = bitmap_UbuntuMonoB_10_0057, 949 | }; 950 | 951 | static unsigned char bitmap_UbuntuMonoB_10_0058[] = { /* 'X' */ 952 | 0xaf, 0xbf, 0x00, 0xb1, 0xaf, 953 | 0x1c, 0xf2, 0x88, 0xf1, 0x1b, 954 | 0x00, 0x71, 0xff, 0x72, 0x00, 955 | 0x00, 0x9d, 0xf4, 0xab, 0x00, 956 | 0x35, 0xf7, 0x3e, 0xfa, 0x41, 957 | 0xc1, 0x9b, 0x00, 0xa3, 0xc3, 958 | }; 959 | 960 | static struct glyph glyph_UbuntuMonoB_10_0058 = { /* 'X' */ 961 | .left = 0, 962 | .top = 6, 963 | .cols = 5, 964 | .rows = 6, 965 | .bitmap = bitmap_UbuntuMonoB_10_0058, 966 | }; 967 | 968 | static unsigned char bitmap_UbuntuMonoB_10_0059[] = { /* 'Y' */ 969 | 0xc3, 0x85, 0x00, 0x77, 0xc6, 970 | 0x48, 0xe5, 0x09, 0xe0, 0x4d, 971 | 0x00, 0xbb, 0xb8, 0xc2, 0x00, 972 | 0x00, 0x27, 0xff, 0x2a, 0x00, 973 | 0x00, 0x00, 0xff, 0x00, 0x00, 974 | 0x00, 0x00, 0xff, 0x00, 0x00, 975 | }; 976 | 977 | static struct glyph glyph_UbuntuMonoB_10_0059 = { /* 'Y' */ 978 | .left = 0, 979 | .top = 6, 980 | .cols = 5, 981 | .rows = 6, 982 | .bitmap = bitmap_UbuntuMonoB_10_0059, 983 | }; 984 | 985 | static unsigned char bitmap_UbuntuMonoB_10_005a[] = { /* 'Z' */ 986 | 0xff, 0xff, 0xff, 0xff, 987 | 0x00, 0x03, 0xd1, 0xa6, 988 | 0x00, 0x6e, 0xe2, 0x10, 989 | 0x14, 0xef, 0x47, 0x00, 990 | 0x93, 0xa6, 0x00, 0x00, 991 | 0xf9, 0xff, 0xff, 0xff, 992 | }; 993 | 994 | static struct glyph glyph_UbuntuMonoB_10_005a = { /* 'Z' */ 995 | .left = 0, 996 | .top = 6, 997 | .cols = 4, 998 | .rows = 6, 999 | .bitmap = bitmap_UbuntuMonoB_10_005a, 1000 | }; 1001 | 1002 | static unsigned char bitmap_UbuntuMonoB_10_0061[] = { /* 'a' */ 1003 | 0xd0, 0xfa, 0xe3, 0x5f, 1004 | 0x16, 0x06, 0x38, 0xed, 1005 | 0x7d, 0xed, 0xf4, 0xff, 1006 | 0xf2, 0x3a, 0x06, 0xff, 1007 | 0x84, 0xf2, 0xf8, 0xde, 1008 | }; 1009 | 1010 | static struct glyph glyph_UbuntuMonoB_10_0061 = { /* 'a' */ 1011 | .left = 0, 1012 | .top = 5, 1013 | .cols = 4, 1014 | .rows = 5, 1015 | .bitmap = bitmap_UbuntuMonoB_10_0061, 1016 | }; 1017 | 1018 | static unsigned char bitmap_UbuntuMonoB_10_0062[] = { /* 'b' */ 1019 | 0xff, 0x00, 0x00, 0x00, 1020 | 0xff, 0x00, 0x00, 0x00, 1021 | 0xff, 0xff, 0xe4, 0x47, 1022 | 0xff, 0x00, 0x4b, 0xd5, 1023 | 0xff, 0x00, 0x07, 0xf7, 1024 | 0xff, 0x00, 0x4e, 0xce, 1025 | 0xdc, 0xf2, 0xd8, 0x39, 1026 | }; 1027 | 1028 | static struct glyph glyph_UbuntuMonoB_10_0062 = { /* 'b' */ 1029 | .left = 0, 1030 | .top = 7, 1031 | .cols = 4, 1032 | .rows = 7, 1033 | .bitmap = bitmap_UbuntuMonoB_10_0062, 1034 | }; 1035 | 1036 | static unsigned char bitmap_UbuntuMonoB_10_0063[] = { /* 'c' */ 1037 | 0x2a, 0xc2, 0xf6, 0xcb, 1038 | 0xc7, 0x68, 0x08, 0x13, 1039 | 0xf6, 0x08, 0x00, 0x00, 1040 | 0xcc, 0x64, 0x07, 0x13, 1041 | 0x2f, 0xc9, 0xf7, 0xd5, 1042 | }; 1043 | 1044 | static struct glyph glyph_UbuntuMonoB_10_0063 = { /* 'c' */ 1045 | .left = 0, 1046 | .top = 5, 1047 | .cols = 4, 1048 | .rows = 5, 1049 | .bitmap = bitmap_UbuntuMonoB_10_0063, 1050 | }; 1051 | 1052 | static unsigned char bitmap_UbuntuMonoB_10_0064[] = { /* 'd' */ 1053 | 0x00, 0x00, 0x00, 0xff, 1054 | 0x00, 0x00, 0x00, 0xff, 1055 | 0x47, 0xe4, 0xff, 0xff, 1056 | 0xd6, 0x47, 0x00, 0xff, 1057 | 0xf8, 0x06, 0x00, 0xff, 1058 | 0xd4, 0x5a, 0x03, 0xff, 1059 | 0x40, 0xdc, 0xf9, 0xdc, 1060 | }; 1061 | 1062 | static struct glyph glyph_UbuntuMonoB_10_0064 = { /* 'd' */ 1063 | .left = 0, 1064 | .top = 7, 1065 | .cols = 4, 1066 | .rows = 7, 1067 | .bitmap = bitmap_UbuntuMonoB_10_0064, 1068 | }; 1069 | 1070 | static unsigned char bitmap_UbuntuMonoB_10_0065[] = { /* 'e' */ 1071 | 0x20, 0xbb, 0xf4, 0xd2, 0x3a, 0x00, 1072 | 0xbc, 0x55, 0x08, 0x4c, 0xd6, 0x00, 1073 | 0xf3, 0xff, 0xff, 0xff, 0xfe, 0x02, 1074 | 0xc2, 0x5c, 0x0a, 0x00, 0x00, 0x00, 1075 | 0x1f, 0xad, 0xec, 0xfb, 0xc9, 0x00, 1076 | }; 1077 | 1078 | static struct glyph glyph_UbuntuMonoB_10_0065 = { /* 'e' */ 1079 | .left = 0, 1080 | .top = 5, 1081 | .cols = 6, 1082 | .rows = 5, 1083 | .bitmap = bitmap_UbuntuMonoB_10_0065, 1084 | }; 1085 | 1086 | static unsigned char bitmap_UbuntuMonoB_10_0066[] = { /* 'f' */ 1087 | 0x00, 0x63, 0xe3, 0xf8, 0xc2, 1088 | 0x00, 0xef, 0x26, 0x0b, 0x22, 1089 | 0xff, 0xff, 0xff, 0xff, 0x00, 1090 | 0x00, 0xff, 0x00, 0x00, 0x00, 1091 | 0x00, 0xff, 0x00, 0x00, 0x00, 1092 | 0x00, 0xff, 0x00, 0x00, 0x00, 1093 | 0x00, 0xff, 0x00, 0x00, 0x00, 1094 | }; 1095 | 1096 | static struct glyph glyph_UbuntuMonoB_10_0066 = { /* 'f' */ 1097 | .left = 0, 1098 | .top = 7, 1099 | .cols = 5, 1100 | .rows = 7, 1101 | .bitmap = bitmap_UbuntuMonoB_10_0066, 1102 | }; 1103 | 1104 | static unsigned char bitmap_UbuntuMonoB_10_0067[] = { /* 'g' */ 1105 | 0x37, 0xd3, 0xf8, 0xd9, 1106 | 0xcf, 0x5f, 0x07, 0xff, 1107 | 0xf7, 0x07, 0x00, 0xff, 1108 | 0xda, 0x47, 0x12, 0xff, 1109 | 0x4e, 0xe7, 0xec, 0xfd, 1110 | 0x00, 0x00, 0x33, 0xe1, 1111 | 0x85, 0xf8, 0xe9, 0x5d, 1112 | }; 1113 | 1114 | static struct glyph glyph_UbuntuMonoB_10_0067 = { /* 'g' */ 1115 | .left = 0, 1116 | .top = 5, 1117 | .cols = 4, 1118 | .rows = 7, 1119 | .bitmap = bitmap_UbuntuMonoB_10_0067, 1120 | }; 1121 | 1122 | static unsigned char bitmap_UbuntuMonoB_10_0068[] = { /* 'h' */ 1123 | 0xff, 0x00, 0x00, 0x00, 1124 | 0xff, 0x00, 0x00, 0x00, 1125 | 0xff, 0xf2, 0xe2, 0x54, 1126 | 0xff, 0x0c, 0x3a, 0xe3, 1127 | 0xff, 0x00, 0x01, 0xff, 1128 | 0xff, 0x00, 0x00, 0xff, 1129 | 0xff, 0x00, 0x00, 0xff, 1130 | }; 1131 | 1132 | static struct glyph glyph_UbuntuMonoB_10_0068 = { /* 'h' */ 1133 | .left = 0, 1134 | .top = 7, 1135 | .cols = 4, 1136 | .rows = 7, 1137 | .bitmap = bitmap_UbuntuMonoB_10_0068, 1138 | }; 1139 | 1140 | static unsigned char bitmap_UbuntuMonoB_10_0069[] = { /* 'i' */ 1141 | 0x00, 0xb8, 0x00, 0x00, 1142 | 0x00, 0x00, 0x00, 0x00, 1143 | 0xff, 0xff, 0x00, 0x00, 1144 | 0x00, 0xff, 0x00, 0x00, 1145 | 0x00, 0xff, 0x00, 0x00, 1146 | 0x00, 0xf2, 0x24, 0x00, 1147 | 0x00, 0x90, 0xf8, 0x9e, 1148 | }; 1149 | 1150 | static struct glyph glyph_UbuntuMonoB_10_0069 = { /* 'i' */ 1151 | .left = 0, 1152 | .top = 7, 1153 | .cols = 4, 1154 | .rows = 7, 1155 | .bitmap = bitmap_UbuntuMonoB_10_0069, 1156 | }; 1157 | 1158 | static unsigned char bitmap_UbuntuMonoB_10_006a[] = { /* 'j' */ 1159 | 0x00, 0xb8, 0x00, 0x00, 1160 | 0x00, 0x00, 0x00, 0x00, 1161 | 0x00, 0xff, 0xff, 0xff, 1162 | 0x00, 0x00, 0x00, 0xff, 1163 | 0x00, 0x00, 0x00, 0xff, 1164 | 0x00, 0x00, 0x00, 0xff, 1165 | 0x00, 0x00, 0x00, 0xff, 1166 | 0x00, 0x00, 0x22, 0xe9, 1167 | 0x14, 0xe2, 0xf7, 0x7a, 1168 | }; 1169 | 1170 | static struct glyph glyph_UbuntuMonoB_10_006a = { /* 'j' */ 1171 | .left = 0, 1172 | .top = 7, 1173 | .cols = 4, 1174 | .rows = 9, 1175 | .bitmap = bitmap_UbuntuMonoB_10_006a, 1176 | }; 1177 | 1178 | static unsigned char bitmap_UbuntuMonoB_10_006b[] = { /* 'k' */ 1179 | 0xff, 0x00, 0x00, 0x00, 1180 | 0xff, 0x00, 0x00, 0x00, 1181 | 0xff, 0x06, 0xcf, 0x92, 1182 | 0xff, 0x97, 0xa9, 0x02, 1183 | 0xff, 0xf1, 0x4d, 0x00, 1184 | 0xff, 0x4a, 0xf0, 0x26, 1185 | 0xff, 0x00, 0x92, 0xa3, 1186 | }; 1187 | 1188 | static struct glyph glyph_UbuntuMonoB_10_006b = { /* 'k' */ 1189 | .left = 0, 1190 | .top = 7, 1191 | .cols = 4, 1192 | .rows = 7, 1193 | .bitmap = bitmap_UbuntuMonoB_10_006b, 1194 | }; 1195 | 1196 | static unsigned char bitmap_UbuntuMonoB_10_006c[] = { /* 'l' */ 1197 | 0xff, 0xff, 0x00, 0x00, 1198 | 0x00, 0xff, 0x00, 0x00, 1199 | 0x00, 0xff, 0x00, 0x00, 1200 | 0x00, 0xff, 0x00, 0x00, 1201 | 0x00, 0xff, 0x00, 0x00, 1202 | 0x00, 0xf1, 0x1f, 0x00, 1203 | 0x00, 0x7f, 0xf6, 0xd5, 1204 | }; 1205 | 1206 | static struct glyph glyph_UbuntuMonoB_10_006c = { /* 'l' */ 1207 | .left = 0, 1208 | .top = 7, 1209 | .cols = 4, 1210 | .rows = 7, 1211 | .bitmap = bitmap_UbuntuMonoB_10_006c, 1212 | }; 1213 | 1214 | static unsigned char bitmap_UbuntuMonoB_10_006d[] = { /* 'm' */ 1215 | 0xdd, 0xf9, 0xd6, 0xf4, 0x96, 1216 | 0xff, 0x1c, 0xf8, 0x19, 0xf5, 1217 | 0xff, 0x00, 0xff, 0x00, 0xff, 1218 | 0xff, 0x00, 0x00, 0x00, 0xff, 1219 | 0xff, 0x00, 0x00, 0x00, 0xff, 1220 | }; 1221 | 1222 | static struct glyph glyph_UbuntuMonoB_10_006d = { /* 'm' */ 1223 | .left = 0, 1224 | .top = 5, 1225 | .cols = 5, 1226 | .rows = 5, 1227 | .bitmap = bitmap_UbuntuMonoB_10_006d, 1228 | }; 1229 | 1230 | static unsigned char bitmap_UbuntuMonoB_10_006e[] = { /* 'n' */ 1231 | 0xd5, 0xf5, 0xe8, 0x5f, 1232 | 0xff, 0x04, 0x3b, 0xe7, 1233 | 0xff, 0x00, 0x01, 0xff, 1234 | 0xff, 0x00, 0x00, 0xff, 1235 | 0xff, 0x00, 0x00, 0xff, 1236 | }; 1237 | 1238 | static struct glyph glyph_UbuntuMonoB_10_006e = { /* 'n' */ 1239 | .left = 0, 1240 | .top = 5, 1241 | .cols = 4, 1242 | .rows = 5, 1243 | .bitmap = bitmap_UbuntuMonoB_10_006e, 1244 | }; 1245 | 1246 | static unsigned char bitmap_UbuntuMonoB_10_006f[] = { /* 'o' */ 1247 | 0x3c, 0xde, 0xdf, 0x3d, 1248 | 0xd2, 0x4b, 0x47, 0xd1, 1249 | 0xf7, 0x06, 0x06, 0xf7, 1250 | 0xd1, 0x45, 0x4b, 0xd1, 1251 | 0x3f, 0xe2, 0xe2, 0x3f, 1252 | }; 1253 | 1254 | static struct glyph glyph_UbuntuMonoB_10_006f = { /* 'o' */ 1255 | .left = 0, 1256 | .top = 5, 1257 | .cols = 4, 1258 | .rows = 5, 1259 | .bitmap = bitmap_UbuntuMonoB_10_006f, 1260 | }; 1261 | 1262 | static unsigned char bitmap_UbuntuMonoB_10_0070[] = { /* 'p' */ 1263 | 0xd8, 0xf8, 0xda, 0x3b, 1264 | 0xff, 0x05, 0x61, 0xd0, 1265 | 0xff, 0x00, 0x08, 0xf7, 1266 | 0xff, 0x0f, 0x49, 0xd5, 1267 | 0xff, 0xe1, 0xe7, 0x49, 1268 | 0xff, 0x00, 0x00, 0x00, 1269 | 0xff, 0x00, 0x00, 0x00, 1270 | }; 1271 | 1272 | static struct glyph glyph_UbuntuMonoB_10_0070 = { /* 'p' */ 1273 | .left = 0, 1274 | .top = 5, 1275 | .cols = 4, 1276 | .rows = 7, 1277 | .bitmap = bitmap_UbuntuMonoB_10_0070, 1278 | }; 1279 | 1280 | static unsigned char bitmap_UbuntuMonoB_10_0071[] = { /* 'q' */ 1281 | 0x39, 0xd6, 0xf8, 0xd8, 1282 | 0xd0, 0x5f, 0x05, 0xff, 1283 | 0xf8, 0x07, 0x00, 0xff, 1284 | 0xd7, 0x49, 0x00, 0xff, 1285 | 0x49, 0xe7, 0xff, 0xff, 1286 | 0x00, 0x00, 0x00, 0xff, 1287 | 0x00, 0x00, 0x00, 0xff, 1288 | }; 1289 | 1290 | static struct glyph glyph_UbuntuMonoB_10_0071 = { /* 'q' */ 1291 | .left = 0, 1292 | .top = 5, 1293 | .cols = 4, 1294 | .rows = 7, 1295 | .bitmap = bitmap_UbuntuMonoB_10_0071, 1296 | }; 1297 | 1298 | static unsigned char bitmap_UbuntuMonoB_10_0072[] = { /* 'r' */ 1299 | 0xc1, 0xf5, 0xdc, 1300 | 0xff, 0x0b, 0x0f, 1301 | 0xff, 0x00, 0x00, 1302 | 0xff, 0x00, 0x00, 1303 | 0xff, 0x00, 0x00, 1304 | }; 1305 | 1306 | static struct glyph glyph_UbuntuMonoB_10_0072 = { /* 'r' */ 1307 | .left = 0, 1308 | .top = 5, 1309 | .cols = 3, 1310 | .rows = 5, 1311 | .bitmap = bitmap_UbuntuMonoB_10_0072, 1312 | }; 1313 | 1314 | static unsigned char bitmap_UbuntuMonoB_10_0073[] = { /* 's' */ 1315 | 0x6f, 0xe5, 0xf8, 0xc8, 1316 | 0xf0, 0x49, 0x0f, 0x28, 1317 | 0x64, 0xe3, 0xda, 0x56, 1318 | 0x35, 0x0e, 0x4b, 0xee, 1319 | 0xbf, 0xf6, 0xeb, 0x7d, 1320 | }; 1321 | 1322 | static struct glyph glyph_UbuntuMonoB_10_0073 = { /* 's' */ 1323 | .left = 0, 1324 | .top = 5, 1325 | .cols = 4, 1326 | .rows = 5, 1327 | .bitmap = bitmap_UbuntuMonoB_10_0073, 1328 | }; 1329 | 1330 | static unsigned char bitmap_UbuntuMonoB_10_0074[] = { /* 't' */ 1331 | 0x00, 0xff, 0x00, 0x00, 1332 | 0xff, 0xff, 0xff, 0xff, 1333 | 0x00, 0xff, 0x00, 0x00, 1334 | 0x00, 0xff, 0x00, 0x00, 1335 | 0x00, 0xf3, 0x18, 0x17, 1336 | 0x00, 0x94, 0xfa, 0xd7, 1337 | }; 1338 | 1339 | static struct glyph glyph_UbuntuMonoB_10_0074 = { /* 't' */ 1340 | .left = 0, 1341 | .top = 6, 1342 | .cols = 4, 1343 | .rows = 6, 1344 | .bitmap = bitmap_UbuntuMonoB_10_0074, 1345 | }; 1346 | 1347 | static unsigned char bitmap_UbuntuMonoB_10_0075[] = { /* 'u' */ 1348 | 0xff, 0x00, 0x00, 0x00, 0xff, 1349 | 0xff, 0x00, 0x00, 0x00, 0xff, 1350 | 0xfe, 0x02, 0x00, 0x00, 0xff, 1351 | 0xe1, 0x57, 0x06, 0x07, 0xff, 1352 | 0x4b, 0xe0, 0xfc, 0xef, 0xce, 1353 | }; 1354 | 1355 | static struct glyph glyph_UbuntuMonoB_10_0075 = { /* 'u' */ 1356 | .left = 0, 1357 | .top = 5, 1358 | .cols = 5, 1359 | .rows = 5, 1360 | .bitmap = bitmap_UbuntuMonoB_10_0075, 1361 | }; 1362 | 1363 | static unsigned char bitmap_UbuntuMonoB_10_0076[] = { /* 'v' */ 1364 | 0xbd, 0x4e, 0x23, 0xe0, 1365 | 0x7e, 0x8b, 0x67, 0x9d, 1366 | 0x38, 0xcf, 0xb5, 0x51, 1367 | 0x02, 0xe7, 0xef, 0x09, 1368 | 0x00, 0x93, 0xa3, 0x00, 1369 | }; 1370 | 1371 | static struct glyph glyph_UbuntuMonoB_10_0076 = { /* 'v' */ 1372 | .left = 0, 1373 | .top = 5, 1374 | .cols = 4, 1375 | .rows = 5, 1376 | .bitmap = bitmap_UbuntuMonoB_10_0076, 1377 | }; 1378 | 1379 | static unsigned char bitmap_UbuntuMonoB_10_0077[] = { /* 'w' */ 1380 | 0xfa, 0x00, 0x00, 0x00, 0xf7, 1381 | 0xee, 0x19, 0xfc, 0x27, 0xe5, 1382 | 0xdc, 0x7b, 0xf5, 0x85, 0xd4, 1383 | 0xc4, 0xe4, 0x49, 0xe7, 0xbc, 1384 | 0xa8, 0x9e, 0x00, 0xa4, 0xa0, 1385 | }; 1386 | 1387 | static struct glyph glyph_UbuntuMonoB_10_0077 = { /* 'w' */ 1388 | .left = 0, 1389 | .top = 5, 1390 | .cols = 5, 1391 | .rows = 5, 1392 | .bitmap = bitmap_UbuntuMonoB_10_0077, 1393 | }; 1394 | 1395 | static unsigned char bitmap_UbuntuMonoB_10_0078[] = { /* 'x' */ 1396 | 0x9a, 0xde, 0x0f, 0xb3, 0xa8, 1397 | 0x06, 0xc6, 0xd8, 0xe6, 0x12, 1398 | 0x00, 0x45, 0xff, 0x8b, 0x00, 1399 | 0x13, 0xde, 0xb7, 0xf7, 0x27, 1400 | 0xae, 0xcb, 0x02, 0xa3, 0xb8, 1401 | }; 1402 | 1403 | static struct glyph glyph_UbuntuMonoB_10_0078 = { /* 'x' */ 1404 | .left = 0, 1405 | .top = 5, 1406 | .cols = 5, 1407 | .rows = 5, 1408 | .bitmap = bitmap_UbuntuMonoB_10_0078, 1409 | }; 1410 | 1411 | static unsigned char bitmap_UbuntuMonoB_10_0079[] = { /* 'y' */ 1412 | 0xcd, 0x37, 0x00, 0x2f, 0xdf, 1413 | 0x63, 0xac, 0x00, 0x92, 0x9e, 1414 | 0x06, 0xe1, 0x48, 0xf0, 0x5a, 1415 | 0x00, 0x5c, 0xf9, 0xfc, 0x13, 1416 | 0x00, 0x00, 0xbb, 0xbc, 0x00, 1417 | 0x00, 0x0a, 0xac, 0x52, 0x00, 1418 | 0xce, 0xf4, 0x8a, 0x00, 0x00, 1419 | }; 1420 | 1421 | static struct glyph glyph_UbuntuMonoB_10_0079 = { /* 'y' */ 1422 | .left = 0, 1423 | .top = 5, 1424 | .cols = 5, 1425 | .rows = 7, 1426 | .bitmap = bitmap_UbuntuMonoB_10_0079, 1427 | }; 1428 | 1429 | static unsigned char bitmap_UbuntuMonoB_10_007a[] = { /* 'z' */ 1430 | 0xff, 0xff, 0xff, 1431 | 0x00, 0x9c, 0xab, 1432 | 0x2b, 0xee, 0x18, 1433 | 0xab, 0x73, 0x00, 1434 | 0xfd, 0xff, 0xff, 1435 | }; 1436 | 1437 | static struct glyph glyph_UbuntuMonoB_10_007a = { /* 'z' */ 1438 | .left = 0, 1439 | .top = 5, 1440 | .cols = 3, 1441 | .rows = 5, 1442 | .bitmap = bitmap_UbuntuMonoB_10_007a, 1443 | }; 1444 | 1445 | static unsigned char bitmap_UbuntuMonoB_10_0030[] = { /* '0' */ 1446 | 0x3c, 0xe1, 0xe2, 0x3d, 1447 | 0xc8, 0x58, 0x5b, 0xc7, 1448 | 0xf4, 0x09, 0xc2, 0xf3, 1449 | 0xf4, 0x09, 0x0a, 0xf2, 1450 | 0xc9, 0x57, 0x59, 0xc7, 1451 | 0x41, 0xe3, 0xe3, 0x3f, 1452 | }; 1453 | 1454 | static struct glyph glyph_UbuntuMonoB_10_0030 = { /* '0' */ 1455 | .left = 0, 1456 | .top = 6, 1457 | .cols = 4, 1458 | .rows = 6, 1459 | .bitmap = bitmap_UbuntuMonoB_10_0030, 1460 | }; 1461 | 1462 | static unsigned char bitmap_UbuntuMonoB_10_0031[] = { /* '1' */ 1463 | 0x05, 0x67, 0xf1, 0x00, 1464 | 0xc6, 0xdd, 0xff, 0x00, 1465 | 0x17, 0x01, 0xff, 0x00, 1466 | 0x00, 0x00, 0xff, 0x00, 1467 | 0x00, 0x00, 0xff, 0x00, 1468 | 0x00, 0xff, 0xff, 0xff, 1469 | }; 1470 | 1471 | static struct glyph glyph_UbuntuMonoB_10_0031 = { /* '1' */ 1472 | .left = 0, 1473 | .top = 6, 1474 | .cols = 4, 1475 | .rows = 6, 1476 | .bitmap = bitmap_UbuntuMonoB_10_0031, 1477 | }; 1478 | 1479 | static unsigned char bitmap_UbuntuMonoB_10_0032[] = { /* '2' */ 1480 | 0x00, 0x97, 0xf1, 0x84, 1481 | 0x00, 0x49, 0x28, 0xf3, 1482 | 0x00, 0x00, 0x5a, 0xc1, 1483 | 0x00, 0x2c, 0xdf, 0x24, 1484 | 0x00, 0xbf, 0x3b, 0x00, 1485 | 0x00, 0xf9, 0xff, 0xff, 1486 | }; 1487 | 1488 | static struct glyph glyph_UbuntuMonoB_10_0032 = { /* '2' */ 1489 | .left = 0, 1490 | .top = 6, 1491 | .cols = 4, 1492 | .rows = 6, 1493 | .bitmap = bitmap_UbuntuMonoB_10_0032, 1494 | }; 1495 | 1496 | static unsigned char bitmap_UbuntuMonoB_10_0033[] = { /* '3' */ 1497 | 0x8f, 0xe3, 0xf8, 0xda, 0x64, 1498 | 0x2c, 0x2e, 0x09, 0x41, 0xea, 1499 | 0x00, 0x00, 0xff, 0xff, 0x81, 1500 | 0x00, 0x00, 0x08, 0x4c, 0xe1, 1501 | 0x2b, 0x14, 0x06, 0x4c, 0xe2, 1502 | 0xb8, 0xf5, 0xf5, 0xc9, 0x3b, 1503 | }; 1504 | 1505 | static struct glyph glyph_UbuntuMonoB_10_0033 = { /* '3' */ 1506 | .left = 0, 1507 | .top = 6, 1508 | .cols = 5, 1509 | .rows = 6, 1510 | .bitmap = bitmap_UbuntuMonoB_10_0033, 1511 | }; 1512 | 1513 | static unsigned char bitmap_UbuntuMonoB_10_0034[] = { /* '4' */ 1514 | 0x00, 0x00, 0x5a, 0xfd, 0x00, 1515 | 0x00, 0x3c, 0xea, 0xff, 0x00, 1516 | 0x13, 0xe1, 0x41, 0xff, 0x00, 1517 | 0xa3, 0x81, 0x00, 0xff, 0x00, 1518 | 0xff, 0xff, 0xff, 0xff, 0xff, 1519 | 0x00, 0x00, 0x00, 0xff, 0x00, 1520 | }; 1521 | 1522 | static struct glyph glyph_UbuntuMonoB_10_0034 = { /* '4' */ 1523 | .left = 0, 1524 | .top = 6, 1525 | .cols = 5, 1526 | .rows = 6, 1527 | .bitmap = bitmap_UbuntuMonoB_10_0034, 1528 | }; 1529 | 1530 | static unsigned char bitmap_UbuntuMonoB_10_0035[] = { /* '5' */ 1531 | 0xbe, 0xff, 0xff, 0xff, 1532 | 0xc7, 0x00, 0x00, 0x00, 1533 | 0xf0, 0xea, 0xb3, 0x2d, 1534 | 0x03, 0x19, 0x6d, 0xdb, 1535 | 0x20, 0x06, 0x35, 0xe5, 1536 | 0xc8, 0xfa, 0xdb, 0x4a, 1537 | }; 1538 | 1539 | static struct glyph glyph_UbuntuMonoB_10_0035 = { /* '5' */ 1540 | .left = 0, 1541 | .top = 6, 1542 | .cols = 4, 1543 | .rows = 6, 1544 | .bitmap = bitmap_UbuntuMonoB_10_0035, 1545 | }; 1546 | 1547 | static unsigned char bitmap_UbuntuMonoB_10_0036[] = { /* '6' */ 1548 | 0x00, 0x51, 0xc5, 0xe5, 1549 | 0x5a, 0xb5, 0x35, 0x0a, 1550 | 0xdc, 0xd6, 0xbd, 0x3d, 1551 | 0xf8, 0x30, 0x52, 0xe3, 1552 | 0xd9, 0x3e, 0x36, 0xe7, 1553 | 0x4c, 0xe4, 0xe7, 0x55, 1554 | }; 1555 | 1556 | static struct glyph glyph_UbuntuMonoB_10_0036 = { /* '6' */ 1557 | .left = 0, 1558 | .top = 6, 1559 | .cols = 4, 1560 | .rows = 6, 1561 | .bitmap = bitmap_UbuntuMonoB_10_0036, 1562 | }; 1563 | 1564 | static unsigned char bitmap_UbuntuMonoB_10_0037[] = { /* '7' */ 1565 | 0xff, 0xff, 0xff, 0xff, 1566 | 0x00, 0x00, 0x50, 0xa2, 1567 | 0x00, 0x04, 0xd2, 0x17, 1568 | 0x00, 0x56, 0x9c, 0x00, 1569 | 0x00, 0xb1, 0x47, 0x00, 1570 | 0x00, 0xe9, 0x16, 0x00, 1571 | }; 1572 | 1573 | static struct glyph glyph_UbuntuMonoB_10_0037 = { /* '7' */ 1574 | .left = 0, 1575 | .top = 6, 1576 | .cols = 4, 1577 | .rows = 6, 1578 | .bitmap = bitmap_UbuntuMonoB_10_0037, 1579 | }; 1580 | 1581 | static unsigned char bitmap_UbuntuMonoB_10_0038[] = { /* '8' */ 1582 | 0x58, 0xe5, 0xf2, 0x84, 1583 | 0xcb, 0x2c, 0x2d, 0xeb, 1584 | 0x70, 0xe2, 0xd1, 0x68, 1585 | 0xc2, 0x4b, 0x7e, 0xc4, 1586 | 0xf1, 0x34, 0x33, 0xf0, 1587 | 0x6d, 0xee, 0xe8, 0x62, 1588 | }; 1589 | 1590 | static struct glyph glyph_UbuntuMonoB_10_0038 = { /* '8' */ 1591 | .left = 0, 1592 | .top = 6, 1593 | .cols = 4, 1594 | .rows = 6, 1595 | .bitmap = bitmap_UbuntuMonoB_10_0038, 1596 | }; 1597 | 1598 | static unsigned char bitmap_UbuntuMonoB_10_0039[] = { /* '9' */ 1599 | 0x50, 0xe7, 0xe2, 0x45, 1600 | 0xe5, 0x2e, 0x44, 0xd5, 1601 | 0xe4, 0x53, 0x33, 0xf6, 1602 | 0x3e, 0xbc, 0xd0, 0xdb, 1603 | 0x0a, 0x38, 0xbd, 0x5a, 1604 | 0xe9, 0xc5, 0x51, 0x00, 1605 | }; 1606 | 1607 | static struct glyph glyph_UbuntuMonoB_10_0039 = { /* '9' */ 1608 | .left = 0, 1609 | .top = 6, 1610 | .cols = 4, 1611 | .rows = 6, 1612 | .bitmap = bitmap_UbuntuMonoB_10_0039, 1613 | }; 1614 | 1615 | static struct glyph *glyphs_UbuntuMonoB_10[] = { 1616 | [33] = &glyph_UbuntuMonoB_10_0021, /* '!' */ 1617 | [64] = &glyph_UbuntuMonoB_10_0040, /* '@' */ 1618 | [35] = &glyph_UbuntuMonoB_10_0023, /* '#' */ 1619 | [36] = &glyph_UbuntuMonoB_10_0024, /* '$' */ 1620 | [37] = &glyph_UbuntuMonoB_10_0025, /* '%' */ 1621 | [94] = &glyph_UbuntuMonoB_10_005e, /* '^' */ 1622 | [38] = &glyph_UbuntuMonoB_10_0026, /* '&' */ 1623 | [42] = &glyph_UbuntuMonoB_10_002a, /* '*' */ 1624 | [40] = &glyph_UbuntuMonoB_10_0028, /* '(' */ 1625 | [41] = &glyph_UbuntuMonoB_10_0029, /* ')' */ 1626 | [95] = &glyph_UbuntuMonoB_10_005f, /* '_' */ 1627 | [43] = &glyph_UbuntuMonoB_10_002b, /* '+' */ 1628 | [45] = &glyph_UbuntuMonoB_10_002d, /* '-' */ 1629 | [61] = &glyph_UbuntuMonoB_10_003d, /* '=' */ 1630 | [123] = &glyph_UbuntuMonoB_10_007b, /* '{' */ 1631 | [125] = &glyph_UbuntuMonoB_10_007d, /* '}' */ 1632 | [124] = &glyph_UbuntuMonoB_10_007c, /* '|' */ 1633 | [91] = &glyph_UbuntuMonoB_10_005b, /* '[' */ 1634 | [93] = &glyph_UbuntuMonoB_10_005d, /* ']' */ 1635 | [92] = &glyph_UbuntuMonoB_10_005c, /* '\' */ 1636 | [58] = &glyph_UbuntuMonoB_10_003a, /* ':' */ 1637 | [34] = &glyph_UbuntuMonoB_10_0022, /* '"' */ 1638 | [59] = &glyph_UbuntuMonoB_10_003b, /* ';' */ 1639 | [39] = &glyph_UbuntuMonoB_10_0027, /* ''' */ 1640 | [60] = &glyph_UbuntuMonoB_10_003c, /* '<' */ 1641 | [62] = &glyph_UbuntuMonoB_10_003e, /* '>' */ 1642 | [63] = &glyph_UbuntuMonoB_10_003f, /* '?' */ 1643 | [44] = &glyph_UbuntuMonoB_10_002c, /* ',' */ 1644 | [46] = &glyph_UbuntuMonoB_10_002e, /* '.' */ 1645 | [47] = &glyph_UbuntuMonoB_10_002f, /* '/' */ 1646 | [96] = &glyph_UbuntuMonoB_10_0060, /* '`' */ 1647 | [126] = &glyph_UbuntuMonoB_10_007e, /* '~' */ 1648 | [32] = &glyph_UbuntuMonoB_10_0020, /* ' ' */ 1649 | [65] = &glyph_UbuntuMonoB_10_0041, /* 'A' */ 1650 | [66] = &glyph_UbuntuMonoB_10_0042, /* 'B' */ 1651 | [67] = &glyph_UbuntuMonoB_10_0043, /* 'C' */ 1652 | [68] = &glyph_UbuntuMonoB_10_0044, /* 'D' */ 1653 | [69] = &glyph_UbuntuMonoB_10_0045, /* 'E' */ 1654 | [70] = &glyph_UbuntuMonoB_10_0046, /* 'F' */ 1655 | [71] = &glyph_UbuntuMonoB_10_0047, /* 'G' */ 1656 | [72] = &glyph_UbuntuMonoB_10_0048, /* 'H' */ 1657 | [73] = &glyph_UbuntuMonoB_10_0049, /* 'I' */ 1658 | [74] = &glyph_UbuntuMonoB_10_004a, /* 'J' */ 1659 | [75] = &glyph_UbuntuMonoB_10_004b, /* 'K' */ 1660 | [76] = &glyph_UbuntuMonoB_10_004c, /* 'L' */ 1661 | [77] = &glyph_UbuntuMonoB_10_004d, /* 'M' */ 1662 | [78] = &glyph_UbuntuMonoB_10_004e, /* 'N' */ 1663 | [79] = &glyph_UbuntuMonoB_10_004f, /* 'O' */ 1664 | [80] = &glyph_UbuntuMonoB_10_0050, /* 'P' */ 1665 | [81] = &glyph_UbuntuMonoB_10_0051, /* 'Q' */ 1666 | [82] = &glyph_UbuntuMonoB_10_0052, /* 'R' */ 1667 | [83] = &glyph_UbuntuMonoB_10_0053, /* 'S' */ 1668 | [84] = &glyph_UbuntuMonoB_10_0054, /* 'T' */ 1669 | [85] = &glyph_UbuntuMonoB_10_0055, /* 'U' */ 1670 | [86] = &glyph_UbuntuMonoB_10_0056, /* 'V' */ 1671 | [87] = &glyph_UbuntuMonoB_10_0057, /* 'W' */ 1672 | [88] = &glyph_UbuntuMonoB_10_0058, /* 'X' */ 1673 | [89] = &glyph_UbuntuMonoB_10_0059, /* 'Y' */ 1674 | [90] = &glyph_UbuntuMonoB_10_005a, /* 'Z' */ 1675 | [97] = &glyph_UbuntuMonoB_10_0061, /* 'a' */ 1676 | [98] = &glyph_UbuntuMonoB_10_0062, /* 'b' */ 1677 | [99] = &glyph_UbuntuMonoB_10_0063, /* 'c' */ 1678 | [100] = &glyph_UbuntuMonoB_10_0064, /* 'd' */ 1679 | [101] = &glyph_UbuntuMonoB_10_0065, /* 'e' */ 1680 | [102] = &glyph_UbuntuMonoB_10_0066, /* 'f' */ 1681 | [103] = &glyph_UbuntuMonoB_10_0067, /* 'g' */ 1682 | [104] = &glyph_UbuntuMonoB_10_0068, /* 'h' */ 1683 | [105] = &glyph_UbuntuMonoB_10_0069, /* 'i' */ 1684 | [106] = &glyph_UbuntuMonoB_10_006a, /* 'j' */ 1685 | [107] = &glyph_UbuntuMonoB_10_006b, /* 'k' */ 1686 | [108] = &glyph_UbuntuMonoB_10_006c, /* 'l' */ 1687 | [109] = &glyph_UbuntuMonoB_10_006d, /* 'm' */ 1688 | [110] = &glyph_UbuntuMonoB_10_006e, /* 'n' */ 1689 | [111] = &glyph_UbuntuMonoB_10_006f, /* 'o' */ 1690 | [112] = &glyph_UbuntuMonoB_10_0070, /* 'p' */ 1691 | [113] = &glyph_UbuntuMonoB_10_0071, /* 'q' */ 1692 | [114] = &glyph_UbuntuMonoB_10_0072, /* 'r' */ 1693 | [115] = &glyph_UbuntuMonoB_10_0073, /* 's' */ 1694 | [116] = &glyph_UbuntuMonoB_10_0074, /* 't' */ 1695 | [117] = &glyph_UbuntuMonoB_10_0075, /* 'u' */ 1696 | [118] = &glyph_UbuntuMonoB_10_0076, /* 'v' */ 1697 | [119] = &glyph_UbuntuMonoB_10_0077, /* 'w' */ 1698 | [120] = &glyph_UbuntuMonoB_10_0078, /* 'x' */ 1699 | [121] = &glyph_UbuntuMonoB_10_0079, /* 'y' */ 1700 | [122] = &glyph_UbuntuMonoB_10_007a, /* 'z' */ 1701 | [48] = &glyph_UbuntuMonoB_10_0030, /* '0' */ 1702 | [49] = &glyph_UbuntuMonoB_10_0031, /* '1' */ 1703 | [50] = &glyph_UbuntuMonoB_10_0032, /* '2' */ 1704 | [51] = &glyph_UbuntuMonoB_10_0033, /* '3' */ 1705 | [52] = &glyph_UbuntuMonoB_10_0034, /* '4' */ 1706 | [53] = &glyph_UbuntuMonoB_10_0035, /* '5' */ 1707 | [54] = &glyph_UbuntuMonoB_10_0036, /* '6' */ 1708 | [55] = &glyph_UbuntuMonoB_10_0037, /* '7' */ 1709 | [56] = &glyph_UbuntuMonoB_10_0038, /* '8' */ 1710 | [57] = &glyph_UbuntuMonoB_10_0039, /* '9' */ 1711 | }; 1712 | 1713 | struct font font_UbuntuMonoB_10 = { 1714 | .name = "name", 1715 | .size = 10, 1716 | .dpi = 72, 1717 | .count = 95, 1718 | .glyphs = glyphs_UbuntuMonoB_10, 1719 | }; 1720 | 1721 | --------------------------------------------------------------------------------