summaryrefslogtreecommitdiff
path: root/gfx/fig.c
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-08-26 01:38:03 -0300
committerWerner Almesberger <werner@almesberger.net>2016-08-26 01:40:30 -0300
commit4aa22e1692b61b758c0a5be669cf24ba67c2695c (patch)
treec7d81ac1fe257d5bdb60cc6ed3d588be33c12c5c /gfx/fig.c
parent910608ba17c7ad3cba78d274d0bbc4037042e145 (diff)
downloadeeshow-4aa22e1692b61b758c0a5be669cf24ba67c2695c.tar.gz
eeshow-4aa22e1692b61b758c0a5be669cf24ba67c2695c.tar.bz2
eeshow-4aa22e1692b61b758c0a5be669cf24ba67c2695c.zip
gfx/fig.c (fig_text): support text styles
Diffstat (limited to 'gfx/fig.c')
-rw-r--r--gfx/fig.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/gfx/fig.c b/gfx/fig.c
index fbb3a8f..96f9ea2 100644
--- a/gfx/fig.c
+++ b/gfx/fig.c
@@ -166,11 +166,28 @@ static void fig_text(void *ctx, int x, int y, const char *s, unsigned size,
enum text_align align, int rot, enum text_style style,
unsigned color, unsigned layer)
{
+ int font;
+
+ switch (style) {
+ case text_italic:
+ font = FONT_HELVETICA_OBLIQUE;
+ break;
+ case text_bold:
+ font = FONT_HELVETICA_BOLD;
+ break;
+ case text_bold_italic:
+ font = FONT_HELVETICA_BOLDOB;
+ break;
+ default:
+ font = FONT_HELVETICA;
+ break;
+ }
+
// Type Depth FontSiz Height
// Just Pen Angle Length
// Color Font Flags X Y
printf("4 %u %d %d -1 %d %f %f 4 0.0 0.0 %d %d %s\\001\n",
- align, color, layer, FONT_HELVETICA_BOLD,
+ align, color, layer, font,
pt(size), rot / 180.0 * M_PI, cx(x), cy(y), s);
}