Download & Extend

Displaying font file list in order

Project:Textimage
Version:5.x-2.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:danielb
Status:closed (fixed)

Issue Summary

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.

Comments

#1

*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);

#2

Assigned to:Anonymous» danielb
Status:active» needs review

I have learned how to make patches :D

AttachmentSize
textimage_fontlist.patch 502 bytes

#3

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.

#4

what

#5

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).

#6

Status:active» fixed

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

#7

Status:fixed» closed (fixed)

#8

very nice ;)