diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /support/dktools/dk4font.c |
Initial commit
Diffstat (limited to 'support/dktools/dk4font.c')
-rw-r--r-- | support/dktools/dk4font.c | 493 |
1 files changed, 493 insertions, 0 deletions
diff --git a/support/dktools/dk4font.c b/support/dktools/dk4font.c new file mode 100644 index 0000000000..55c760616b --- /dev/null +++ b/support/dktools/dk4font.c @@ -0,0 +1,493 @@ +/* + WARNING: This file was generated by dkct. + Changes you make here will be lost if dkct is run again! + You should modify the original source and run dkct on it. + Original source: dk4font.ctr +*/ + +/* +Copyright (C) 2016-2017, Dirk Krause + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above opyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +* Neither the name of the author nor the names of contributors may be used + to endorse or promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/** @file dk4font.c The dk4font module. +*/ + + +#line 130 "dk4font.ctr" + + +#include "dk4font.h" + + +#include <stdio.h> + +#if DK4_HAVE_STDLIB_H +#include <stdlib.h> +#endif + +#if DK4_HAVE_UNISTD_H +#include <unistd.h> +#endif + + + +#line 146 "dk4font.ctr" + + + +static const char * const dk4font_ps_names[] = { +/* 0 */ +"Times-Roman", + +/* 1 */ +"Times-Italic", + +/* 2 */ +"Times-Bold", + +/* 3 */ +"Times-BoldItalic", + +/* 4 */ +"AvantGarde-Book", + +/* 5 */ +"AvantGarde-BookOblique", + +/* 6 */ +"AvantGarde-Demi", + +/* 7 */ +"AvantGarde-DemiOblique", + +/* 8 */ +"Bookman-Light", + +/* 9 */ +"Bookman-LightItalic", + +/* 10 */ +"Bookman-Demi", + +/* 11 */ +"Bookman-DemiItalic", + +/* 12 */ +"Courier", + +/* 13 */ +"Courier-Oblique", + +/* 14 */ +"Courier-Bold", + +/* 15 */ +"Courier-BoldOblique", + +/* 16 */ +"Helvetica", + +/* 17 */ +"Helvetica-Oblique", + +/* 18 */ +"Helvetica-Bold", + +/* 19 */ +"Helvetica-BoldOblique", + +/* 20 */ +"Helvetica-Narrow", + +/* 21 */ +"Helvetica-Narrow-Oblique", + +/* 22 */ +"Helvetica-Narrow-Bold", + +/* 23 */ +"Helvetica-Narrow-BoldOblique", + +/* 24 */ +"NewCenturySchlbk-Roman", + +/* 25 */ +"NewCenturySchlbk-Italic", + +/* 26 */ +"NewCenturySchlbk-Bold", + +/* 27 */ +"NewCenturySchlbk-BoldItalic", + +/* 28 */ +"Palatino-Roman", + +/* 29 */ +"Palatino-Italic", + +/* 30 */ +"Palatino-Bold", + +/* 31 */ +"Palatino-BoldItalic", + +/* 32 */ +"Symbol", + +/* 33 */ +"ZapfChancery-MediumItalic", + +/* 34 */ +"ZapfDingbats", + +NULL + + +#line 187 "dk4font.ctr" +}; + + + +static const char * const dk4font_tex_family_names[] = { +/* 0 */ +"ptm", + +/* 1 */ +"ptm", + +/* 2 */ +"ptm", + +/* 3 */ +"ptm", + +/* 4 */ +"pag", + +/* 5 */ +"pag", + +/* 6 */ +"pag", + +/* 7 */ +"pag", + +/* 8 */ +"pbk", + +/* 9 */ +"pbk", + +/* 10 */ +"pbk", + +/* 11 */ +"pbk", + +/* 12 */ +"pcr", + +/* 13 */ +"pcr", + +/* 14 */ +"pcr", + +/* 15 */ +"pcr", + +/* 16 */ +"phv", + +/* 17 */ +"phv", + +/* 18 */ +"phv", + +/* 19 */ +"phv", + +/* 20 */ +"phv", + +/* 21 */ +"phv", + +/* 22 */ +"phv", + +/* 23 */ +"phv", + +/* 24 */ +"pnc", + +/* 25 */ +"pnc", + +/* 26 */ +"pnc", + +/* 27 */ +"pnc", + +/* 28 */ +"ppl", + +/* 29 */ +"ppl", + +/* 30 */ +"ppl", + +/* 31 */ +"ppl", + +/* 32 */ +"psy", + +/* 33 */ +"pzc", + +/* 34 */ +"pzd", + +NULL + + +#line 229 "dk4font.ctr" +}; + + + +static const char * const dk4font_tex_names[] = { +/* 0 */ +"ptmr", + +/* 1 */ +"ptmri", + +/* 2 */ +"ptmb", + +/* 3 */ +"ptmbi", + +/* 4 */ +"pagk", + +/* 5 */ +"pagko", + +/* 6 */ +"pagd", + +/* 7 */ +"pagdo", + +/* 8 */ +"pbkl", + +/* 9 */ +"pbkli", + +/* 10 */ +"pbkd", + +/* 11 */ +"pbkdi", + +/* 12 */ +"pcrr", + +/* 13 */ +"pcrro", + +/* 14 */ +"pcrb", + +/* 15 */ +"pcrbo", + +/* 16 */ +"phvr", + +/* 17 */ +"phvro", + +/* 18 */ +"phvb", + +/* 19 */ +"phvbo", + +/* 20 */ +"phvrrn", + +/* 21 */ +"phvron", + +/* 22 */ +"phvbrn", + +/* 23 */ +"phvbon", + +/* 24 */ +"pncr", + +/* 25 */ +"pncri", + +/* 26 */ +"pncb", + +/* 27 */ +"pncbi", + +/* 28 */ +"pplr", + +/* 29 */ +"pplri", + +/* 30 */ +"pplb", + +/* 31 */ +"pplbi", + +/* 32 */ +"psyr", + +/* 33 */ +"pzcmi", + +/* 34 */ +"pzdr", + +NULL + + +#line 271 "dk4font.ctr" +}; + + + +const int dk4font_features[] = { +0, +DK4_FONT_FEATURE_ITALIC, +DK4_FONT_FEATURE_BOLD, +(DK4_FONT_FEATURE_ITALIC | DK4_FONT_FEATURE_BOLD), +DK4_FONT_FEATURE_SANS_SERIF, +(DK4_FONT_FEATURE_SANS_SERIF | DK4_FONT_FEATURE_OBLIQUE), +(DK4_FONT_FEATURE_SANS_SERIF | DK4_FONT_FEATURE_BOLD), +(DK4_FONT_FEATURE_SANS_SERIF | DK4_FONT_FEATURE_BOLD | DK4_FONT_FEATURE_OBLIQUE), +0, +DK4_FONT_FEATURE_ITALIC, +DK4_FONT_FEATURE_BOLD, +(DK4_FONT_FEATURE_BOLD | DK4_FONT_FEATURE_ITALIC), +DK4_FONT_FEATURE_TTY, +(DK4_FONT_FEATURE_TTY | DK4_FONT_FEATURE_OBLIQUE), +(DK4_FONT_FEATURE_TTY | DK4_FONT_FEATURE_BOLD), +(DK4_FONT_FEATURE_TTY | DK4_FONT_FEATURE_BOLD | DK4_FONT_FEATURE_OBLIQUE), +DK4_FONT_FEATURE_SANS_SERIF, +(DK4_FONT_FEATURE_SANS_SERIF | DK4_FONT_FEATURE_OBLIQUE), +(DK4_FONT_FEATURE_SANS_SERIF | DK4_FONT_FEATURE_BOLD), +(DK4_FONT_FEATURE_SANS_SERIF | DK4_FONT_FEATURE_BOLD | DK4_FONT_FEATURE_OBLIQUE), +(DK4_FONT_FEATURE_SANS_SERIF | DK4_FONT_FEATURE_NARROW), +( + DK4_FONT_FEATURE_SANS_SERIF | DK4_FONT_FEATURE_NARROW + | DK4_FONT_FEATURE_OBLIQUE +), +(DK4_FONT_FEATURE_SANS_SERIF | DK4_FONT_FEATURE_NARROW | DK4_FONT_FEATURE_BOLD), +( + DK4_FONT_FEATURE_SANS_SERIF | DK4_FONT_FEATURE_NARROW + | DK4_FONT_FEATURE_BOLD | DK4_FONT_FEATURE_OBLIQUE +), +0, +DK4_FONT_FEATURE_ITALIC, +DK4_FONT_FEATURE_BOLD, +(DK4_FONT_FEATURE_BOLD | DK4_FONT_FEATURE_ITALIC), +0, +DK4_FONT_FEATURE_ITALIC, +DK4_FONT_FEATURE_BOLD, +(DK4_FONT_FEATURE_BOLD | DK4_FONT_FEATURE_ITALIC), +DK4_FONT_FEATURE_SYMBOL, +DK4_FONT_FEATURE_ITALIC, +DK4_FONT_FEATURE_SYMBOL +}; + + +const char * +dk4font_get_ps_name(dk4_font_number_t fno) +{ + if (DK4_FONT_PS_MAX >= fno) { + return (dk4font_ps_names[fno]); + } + return NULL; +} + + + +const char * +dk4font_get_latex_family_name(dk4_font_number_t fno) +{ + if (DK4_FONT_PS_MAX >= fno) { + return (dk4font_tex_family_names[fno]); + } + return NULL; +} + + + +const char * +dk4font_get_latex_font_name(dk4_font_number_t fno) +{ + if (DK4_FONT_PS_MAX >= fno) { + return (dk4font_tex_names[fno]); + } + return NULL; +} + + + +int +dk4font_get_features(dk4_font_number_t fno) +{ + if (DK4_FONT_PS_MAX >= fno) { + return (dk4font_features[fno]); + } + return 0; +} + + + +/* vim: set ai sw=4 ts=4 : */ |