e9cd3eef710ba3141d58ef119006b7d2327e5b7f markd Wed Dec 9 13:52:01 2020 -0800 fixed accidently backout of master changes in the last merge diff --git src/hg/hgTracks/config.c src/hg/hgTracks/config.c index 4d517c9..b2e49fd 100644 --- src/hg/hgTracks/config.c +++ src/hg/hgTracks/config.c @@ -95,30 +95,52 @@ "n021003l.pfb", "n021004l.pfb", "n021023l.pfb", "n021024l.pfb", "n022003l.pfb", "n022004l.pfb", "n022023l.pfb", "n022024l.pfb", "z003034l.pfb", }; char *emptyStyles[] = { "Normal" }; +void maybeNewFonts(struct hvGfx *hvg) +/* Check to see if we want to use the alternate font engine (FreeType2). */ +{ +if (sameString(cfgOptionDefault("freeType", "off"), "on")) + { + if (sameString(tl.textFont, "Bitmap")) + return; + + char *fontDir = cfgOptionDefault("freeTypeDir", "/usr/share/fonts/default/Type1"); + char buffer[4096]; + + int ii; + for(ii=0; ii < ArraySize(freeTypeFontNames); ii++) + if (sameString(freeTypeFontNames[ii], tl.textFont)) + break; + char *fontFile = freeTypeFontFiles[ii]; + char *fontName = freeTypeFontNames[ii]; + safef(buffer, sizeof buffer, "%s/%s", fontDir, fontFile); + hvGfxSetFontMethod(hvg, FONT_METHOD_FREETYPE, fontName, buffer ); + } +} + static void textFontDropDown() /* Create drop down for font size. */ { /* get current values for font and style */ char *currentFontName = cloneString(tl.textFont); char *currentStyle = strchr(currentFontName, '-'); if (currentStyle) *currentStyle++ = 0; else currentStyle = "Normal"; char *faceNames[sizeof(freeTypeFontNames)]; int ii; int numFonts = 0; struct dyString *dy = dyStringNew(1024);