# getFontList() does not gather alphabetically

**URL:** <https://forum.kirupa.com/t/getfontlist-does-not-gather-alphabetically/61795>\
**Category:** Uncategorized\
**Created:** [August 21, 2004, 10:32pm UTC](https://forum.kirupa.com/t/getfontlist-does-not-gather-alphabetically/61795 "2004-08-21T22:32:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prophet](https://avatars.discourse-cdn.com/v4/letter/p/838e76/32.png) [@Prophet](https://forum.kirupa.com/u/Prophet)\
**Post date:** [August 21, 2004, 10:32pm UTC](https://forum.kirupa.com/t/getfontlist-does-not-gather-alphabetically/61795/1 "2004-08-21T22:32:48Z")

</div>

i have a combobox with instance name _fonts_ and this code on frame 1:

```auto
fontAr = new Array
  fontAr = TextField.getFontList()
  for (i=0;i<fontAr.length;i++) {
      fonts.addItem(fontAr*)
      trace(fontAr*)
  }

```

it simply populates the combobox with all the fonts on your system…

but it is not very user friendly…

it would appear it orders them in order of date, which were last installed/made…

but if i am to actually **USE** this it would actually have some use if it were alphabetical…

so my question is this:

\*\* how can i re-arrange an array in alphabetical order? \*\*

nice, simple one-liner for u guys… but im afraid im not v good with arrays so ther may wel b a one line answer!!

please help pronto!

cheers,

Prophet.

PS im on FMX, **NOT** FMX 2004 😉

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 21, 2004, 10:47pm UTC](https://forum.kirupa.com/t/getfontlist-does-not-gather-alphabetically/61795/2 "2004-08-21T22:47:18Z")

</div>

use array.sort()

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 21, 2004, 10:49pm UTC](https://forum.kirupa.com/t/getfontlist-does-not-gather-alphabetically/61795/3 "2004-08-21T22:49:14Z")

</div>

> [@Prophet](#):
>
> ther may wel b a one line answer!!

sen? ur a dude 😉 lol cheers

Prophet.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 21, 2004, 11:16pm UTC](https://forum.kirupa.com/t/getfontlist-does-not-gather-alphabetically/61795/4 "2004-08-21T23:16:53Z")

</div>

yes, I tried to keep it as one-liner as possible :pleased:
