I am using textimage with a fonts directory that has a LOT of fonts. It is difficult to browse for them because
- They are not in alphabetical order
- Some filenames are all lower case, some are all uppercase, some are mixed, making it very difficult to read.

(Someone suggested I 'type' into the select box to get the font that I want - however this hasn't proved to be effective, because often the only difference between font files in different parts of the list is one or two letters at the end. It would be nice if similar fonts were listed next to each other, so we could see "oh there's a bold version, and italic version, etc...".

Here is what I've done to rectify this:

find this line in textimage.module:
[code]
$form['settings']['text']['font'] = array(
[/code]
and right before it, insert this:
[code]
foreach($font_options as $font=>$options) {
$font_options[$font] = strtolower($font_options[$font]);
}
asort($font_options);
[/code]

The loop converts all the listed options into lowercase for consistency. The asort part then alphabetizes the list.

Please consider doing something similar in future revisions of textimage. I do not posses the means to create a patch.

CommentFileSizeAuthor
#2 textimage_fontlist.patch502 bytesdanielb

Comments

danielb’s picture

*sigh* for your benefit:

find this line in textimage.module:

$form['settings']['text']['font'] = array(

and right before it, insert this:

foreach($font_options as $font=>$options) {
$font_options[$font] = strtolower($font_options[$font]);
}
asort($font_options);
danielb’s picture

Assigned: Unassigned » danielb
Status: Active » Needs review
StatusFileSize
new502 bytes

I have learned how to make patches :D

GreenJelly’s picture

I understand these patch files... still dont know how they work... I am not having this problem, but I have seen better test results if you put the entire function that needs to be tested up.

danielb’s picture

what

deciphered’s picture

Version: 5.x-1.2 » 5.x-2.x-dev
Status: Needs review » Active

@danielb

Patch is good as is the idea, however I've done you one better, the next dev build will actually display the real name of the font (in alphabetical order).

deciphered’s picture

Status: Active » Fixed

Committed to HEAD.
Will be available shortly in 5.x-2.x-dev.

deciphered’s picture

Status: Fixed » Closed (fixed)
danielb’s picture

very nice ;)