50214f805964207ffae51a783513167cb51f5e2e braney Tue Sep 29 17:49:32 2020 -0700 support font choice in freetype font support diff --git src/hg/hgTracks/config.c src/hg/hgTracks/config.c index 70b7ecb..8fb24d2 100644 --- src/hg/hgTracks/config.c +++ src/hg/hgTracks/config.c @@ -43,30 +43,108 @@ for (el = themes; el != NULL && i<50; el = el->next) { char* name = el->name; name = chopPrefix(name); // chop off first two words name = chopPrefix(name); labels[i] = name; i++; } char* currentTheme = cartOptionalString(cart, "theme"); hDropList("theme", labels, i, currentTheme); slFreeList(themes); hPrintf("</TD>"); } +char *freeTypeFontNames[] = { +"gothic medium-r", +"gothic semibold-r", +"gothic medium-o", +"gothic semibold-o", +"bookman medium-r", +"bookman bold-r", +"bookman medium-i", +"bookman bold-i", +"schoolbook medium-r", +"schoolbook bold-r", +"schoolbook medium-i", +"schoolbook bold-i", +"nimbus sans medium-r", +"nimbus sans bold-r", +"nimbus sans medium-i", +"nimbus sans bold-i", +"nimbus sans medium-r-condensed", +"nimbus sans bold-r-condensed", +"nimbus sans medium-i-condensed", +"nimbus sans bold-i-condensed", +"nimbus roman medium-r", +"nimbus roman bold-r", +"nimbus roman medium-i", +"nimbus roman bold-i", +"nimbus mono l-medium-r", +"nimbus mono l-bold-r", +"nimbus mono l-medium-o", +"nimbus mono l-bold-o", +"palladio medium-r", +"palladio bold-r", +"palladio medium-i", +"palladio bold-i", +"chancery" +}; + +char *freeTypeFontFiles[] = { +"a010013l.pfb", +"a010015l.pfb", +"a010033l.pfb", +"a010035l.pfb", +"b018012l.pfb", +"b018015l.pfb", +"b018032l.pfb", +"b018035l.pfb", +"c059013l.pfb", +"c059016l.pfb", +"c059033l.pfb", +"c059036l.pfb", +"n019003l.pfb", +"n019004l.pfb", +"n019023l.pfb", +"n019024l.pfb", +"n019043l.pfb", +"n019044l.pfb", +"n019063l.pfb", +"n019064l.pfb", +"n021003l.pfb", +"n021004l.pfb", +"n021023l.pfb", +"n021024l.pfb", +"n022003l.pfb", +"n022004l.pfb", +"n022023l.pfb", +"n022024l.pfb", +"p052003l.pfb", +"p052004l.pfb", +"p052023l.pfb", +"p052024l.pfb", +"z003034l.pfb", +}; + +static void textFontDropDown() +/* Create drop down for font size. */ +{ +hDropList(textFontVar, freeTypeFontNames, ArraySize(freeTypeFontNames), tl.textFont); +} + static void textSizeDropDown() /* Create drop down for font size. */ { static char *sizes[] = {"6", "8", "10", "12", "14", "18", "24", "34"}; hDropList(textSizeVar, sizes, ArraySize(sizes), tl.textSize); } static void trackConfig(struct track *trackList, struct group *groupList, char *groupTarget, int changeVis) /* Put up track configurations. If groupTarget is * NULL then set visibility for tracks in all groups. Otherwise, * just set it for the given group. If vis is -2, then visibility is * unchanged. If -1 then set visibility to default, otherwise it should * be tvHide, tvDense, etc. */ { @@ -439,30 +517,39 @@ if (trackLayoutInclFontExtras()) { hPrintf("<TD>"); char *defaultStyle = cartUsualString(cart, "fontType", "medium"); cartMakeRadioButton(cart, "fontType", "medium", defaultStyle); hPrintf(" medium "); cartMakeRadioButton(cart, "fontType", "fixed", defaultStyle); hPrintf(" fixed "); cartMakeRadioButton(cart, "fontType", "bold", defaultStyle); hPrintf(" bold "); hPrintf(" "); hPrintf("</TD>"); } hPrintf("</TR>"); +if (sameString(cfgOptionDefault("freeType", "off"), "on")) + { + hPrintf("<TR><TD>font:"); + hPrintf("<TD style=\"text-align: right\">"); + textFontDropDown(); + hPrintf("</TD>"); + hPrintf("</TR>"); + } + themeDropDown(cart); hTableStart(); if (ideoTrack != NULL) { hPrintf("<TR><TD>"); hCheckBox("ideogram", cartUsualBoolean(cart, "ideogram", TRUE)); hPrintf("</TD><TD>"); hPrintf("Display chromosome ideogram above main graphic"); hPrintf("</TD></TR>\n"); } hPrintf("<TR><TD>"); hCheckBox("guidelines", cartUsualBoolean(cart, "guidelines", TRUE)); hPrintf("</TD><TD>"); hPrintf("Show light blue vertical guidelines, or light red vertical window separators in multi-region view");