From: Matthew Fernandez Date: Sat, 14 Jan 2023 05:39:59 +0000 (-0800) Subject: glcomp: remove 'type' that is always set to 'pangotext' X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=46d9ed13a72f626a8c59ca119868e8755210d2e7;p=graphviz glcomp: remove 'type' that is always set to 'pangotext' --- diff --git a/cmd/smyrna/draw.c b/cmd/smyrna/draw.c index 162175eb4..26463e9ef 100644 --- a/cmd/smyrna/draw.c +++ b/cmd/smyrna/draw.c @@ -366,7 +366,7 @@ static void EmbedText(sdot_op* o, int param) char **ptr = &escaped; (void)xml_escape(o->op.u.text.text, flags, put, ptr); - o->font = glNewFont(view->widgets, escaped, &view->penColor, pangotext, + o->font = glNewFont(view->widgets, escaped, &view->penColor, font_op->op.u.font.name, font_op->op.u.font.size, 0); free(escaped); diff --git a/lib/glcomp/glcompdefs.h b/lib/glcomp/glcompdefs.h index 3c8fb4502..7751da909 100644 --- a/lib/glcomp/glcompdefs.h +++ b/lib/glcomp/glcompdefs.h @@ -78,7 +78,6 @@ extern "C" { #define GLCOMP_DEFAULT_WIDTH 10.0f #define GLCOMP_DEFAULT_HEIGHT 10.0f - typedef enum { gluttext, pangotext } glCompFontType; typedef enum { glAlignNone, glAlignLeft, glAlignTop, glAlignBottom, glAlignRight, glAlignParent, glAlignCenter } glCompAlignment; @@ -185,7 +184,6 @@ extern "C" { typedef struct { char *fontdesc; //font description , only used with pango fonts glCompColor color; - glCompFontType type; void *glutfont; /*glut font pointer if used */ int transparent; glCompTex *tex; /* texture, if type is pangotext */ diff --git a/lib/glcomp/glcompfont.c b/lib/glcomp/glcompfont.c index 65fcf12bc..6b4a5f6f1 100644 --- a/lib/glcomp/glcompfont.c +++ b/lib/glcomp/glcompfont.c @@ -45,7 +45,7 @@ void glDeleteFont(glCompFont * f) } -glCompFont *glNewFont (glCompSet * s, char *text, glCompColor * c,glCompFontType type, char *fontdesc, int fs,int is2D) +glCompFont *glNewFont (glCompSet * s, char *text, glCompColor * c, char *fontdesc, int fs,int is2D) { glCompFont *font = gv_alloc(sizeof(glCompFont)); font->reference = 0; @@ -55,13 +55,9 @@ glCompFont *glNewFont (glCompSet * s, char *text, glCompColor * c,glCompFontType font->color.A = c->A; font->justify.VJustify = GL_FONTVJUSTIFY; font->justify.HJustify = GL_FONTHJUSTIFY; - font->type=type; font->is2D=is2D; - if (font->type == gluttext) - font->glutfont = DEFAULT_GLUT_FONT; - else - font->glutfont = NULL; + font->glutfont = NULL; font->fontdesc = gv_strdup(fontdesc); font->size = fs; @@ -90,7 +86,6 @@ glCompFont *glNewFontFromParent(glCompObj * o, char *text) font->color.B = parent->font->color.B; font->color.A = parent->font->color.A; - font->type = parent->font->type; font->glutfont = parent->font->glutfont; font->fontdesc = gv_strdup(parent->font->fontdesc); font->size = parent->font->size; @@ -113,8 +108,7 @@ glCompFont *glNewFontFromParent(glCompObj * o, char *text) c.G = GLCOMPSET_FONT_COLOR_G; c.B = GLCOMPSET_FONT_COLOR_B; c.A = GLCOMPSET_FONT_COLOR_ALPHA; - font = - glNewFont (o->common.compset, text, &c, pangotext, + font = glNewFont(o->common.compset, text, &c, GLCOMPSET_FONT_DESC, GLCOMPSET_FONT_SIZE,1); } return font; diff --git a/lib/glcomp/glcompfont.h b/lib/glcomp/glcompfont.h index 1562473ce..432913565 100644 --- a/lib/glcomp/glcompfont.h +++ b/lib/glcomp/glcompfont.h @@ -27,7 +27,7 @@ extern "C" { void glprintfglut(void *font, GLfloat xpos, GLfloat ypos, GLfloat zpos, char *bf); glCompFont *glNewFont(glCompSet * s, char *text, glCompColor * c, - glCompFontType type, char *fontdesc, int fs,int is2D); + char *fontdesc, int fs,int is2D); glCompFont *glNewFontFromParent(glCompObj * o, char *text); void glDeleteFont(glCompFont * f); void glCompDrawText(glCompFont * f,GLfloat x,GLfloat y);