cleanup
This commit is contained in:
parent
2a8eb7286c
commit
e976146aca
38
bar.c
38
bar.c
|
@ -1020,29 +1020,29 @@ parse_font_list (char *str)
|
||||||
if (!str)
|
if (!str)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
tok = strtok(str, ",");
|
mfont = str; // font face
|
||||||
if (tok) {
|
|
||||||
mfont = tok; // font face
|
|
||||||
|
|
||||||
// if a colon is found
|
// check for a colon
|
||||||
tok = strtok(mfont, ":");
|
tok = strtok(mfont, ":");
|
||||||
|
// if there's a string before the colon
|
||||||
|
if(tok) {
|
||||||
|
// treat the string before the colon as the font face
|
||||||
|
mfont = tok;
|
||||||
|
|
||||||
|
// check for characters after the colon
|
||||||
|
tok = strtok(NULL, ":");
|
||||||
|
// if they exist
|
||||||
if(tok) {
|
if(tok) {
|
||||||
// treat the string before the colon as the font face
|
double candidate_size;
|
||||||
mfont = tok; // font face
|
// convert them to a double
|
||||||
|
candidate_size = atof(tok);
|
||||||
// if characters exist after the colon
|
// if the size is non-zero
|
||||||
tok = strtok(NULL, ":");
|
if(candidate_size != 0) {
|
||||||
if(tok) {
|
// use as the new font size
|
||||||
double candidate_size;
|
mfont_size = candidate_size;
|
||||||
candidate_size = atof(tok);
|
|
||||||
// and the size is non-zero
|
|
||||||
if(candidate_size != 0) {
|
|
||||||
// treat the rest of the string as the font size
|
|
||||||
mfont_size = candidate_size; // font size
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user