I have an array of font names which comes to me in terms of width, and then in terms of weight (alphabetically). The standard width has no indicator within the string like the other widths do (condensed, expanded etc). Here's what the array looks like when I get it:
Array (
[0] => Bold
[1] => ExtraBold
[2] => ExtraLight
[3] => Light
[4] => Medium
[5] => Regular
[6] => SemiBold
[7] => Thin
[8] => Condensed Bold
[9] => Condensed ExtraBold
[10] => Condensed ExtraLight
[11] => Condensed Light
[12] => Condensed Medium
[13] => Condensed Regular
[14] => Condensed SemiBold
[15] => Condensed Thin
[16] => Expanded Black
[17] => Expanded Bold
[18] => Expanded ExtraBold
[19] => Expanded ExtraLight
[20] => Expanded Light
[21] => Expanded Medium
[22] => Expanded Regular
[23] => Expanded SemiBold
[24] => Expanded Thin)
I need to then sort it first according to this width order:
$order_array_crit_one = array("Expanded", "Standard", "Condensed");
And then according to weight in this order:
$order_array_crit_two = array("Black", "ExtraBold", "Bold", "SemiBold", "Medium", "Regular", "Light", "Thin", "ExtraLight");
I kind of worked it out using a sort function that compared words (like this), but every solution I've come up with so far has been bulky and confusing.