int main(int argc, char *argv[]) { float sz, arg; int c; char *myname = "mag"; short done; /* prototypes */ int fontsize(double); double stepsize(double); while (--argc > 0 && (*++argv)[0] == '-') { if (isdigit((int)(*argv)[1])) { /* allow negative numbers as arguments */ break; } done=0; while ((!done) && (c = *++argv[0])) /* allow -bcK like options */ switch (c) { case 'r': invert = 1; break; case 'R': if (*++argv[0] == '\0') { argc--; argv++; } DPI = atof(argv[0]); done = 1; break; default: fatal("%s: %c illegal option\n", myname, c); } } if (argc < 1) fatal("Usage: %s [-r] [-Rdpi] size . . .\n", myname); for ( ; argc; argc--, argv++) { arg=atof(argv[0]); switch (invert) { case 0: printf("%d%c", fontsize(arg), argc > 1 ? ' ' : '\n'); break; case 1: sz=stepsize(arg); if (((int)(10*sz))%10==0) printf("%d%c", (int)sz, argc > 1 ? ' ' : '\n'); else printf("%f%c", sz, argc > 1 ? ' ' : '\n'); } } return 0; }
bool freetype::fontsize(unsigned int size) { return fontsize(size, size); }
freetype::freetype(const char* font_file, int face_index, unsigned int size) : impl_(new implement) { FT_New_Face(implement::library, font_file, face_index, &impl_->face_); fontsize(size); }