static void rightLabel(struct hvGfx *hvg, struct genoLay *gl, struct genoLayChrom *chrom, int yOffset, int fontHeight, int color) /* Draw a chromosome with label on left. */ { hvGfxText(hvg, chrom->x + chrom->width + gl->spaceWidth, chrom->y + yOffset, color, gl->font, chrom->shortName); }
void wrapTextAndCenter(struct hvGfx *hvg, int xOff, int yOff, int width, int height, MgFont *font, Color color, char *text) /* Try and word-wrap text into box more or less. */ { struct slName *word, *wordList = slNameListFromString(text, ' '); int wordCount = slCount(wordList); int fontHeight = tl.fontHeight; int lineCount = height / fontHeight; int yUsed, y; if (lineCount > wordCount) lineCount = wordCount; yUsed = lineCount * fontHeight; y = (height - yUsed)/2 + yOff; for (word = wordList; word != NULL; word = word->next) { hvGfxText(hvg, xOff, y, color, font, word->name); y += fontHeight; } }