when you view the output in notepad it seems to output in a line by line way but if you use a better editor you will see it outputs the registry file in a different format. That could be why you are unable to get the fonts in a readable manner.
seems most are just using HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\\Fonts to get the systems font folder path and doing a findfile on .TFF in that folder in which they save and read from.
This is a very basic way to do it. Note you will need to improve it to meet your needs and this assumes your font folder is c windows font
alias testfonts {
write -c fonts.txt
var %getfonts $file($findfile(C:\WINDOWS\Fonts,*.ttf,0,write fonts.txt $+($replace($truetype($1-).fullname,$chr(32),\<img src='http://www.tg007.net/forum/public/style_emoticons/<#EMO_DIR#>/cool.gif' class='bbc_emoticon' alt='B)' />,%getfonts)))
}
; Credits to Kamek for these 2 aliases - http://www.mircscripts.org/
alias truetype {
if (!$isfile($1)) { return }
var %fn = $iif(("*" iswm $1), $1, $+(", $1, ")), %ntables, %i = 1, %p, %namepos, %namelen, %nid = 1
if ($findtok(copyright family subfamily id fullname version postscript trademark manufacturer designer - urlvendor urldesigner, $prop, 32)) { %nid = $calc($ifmatch - 1) }
bread %fn 0 8192 &font
if ($bvar(&font, 1, 4) != 0 1 0 0) { return }
%ntables = $bvar(&font, 5).nword
while (%i <= %ntables) {
%p = $calc(13 + (%i - 1) * 16)
if (%p > 8192) { return }
if ($bvar(&font, %p, 4).text === name) { %namepos = $bvar(&font, $calc(%p + 8)).nlong | %namelen = $bvar(&font, $calc(%p + 12)).nlong | break }
inc %i
}
if (!%namepos) { return }
if (%namelen > 8192) { %namelen = 8192 }
bread %fn %namepos %namelen &font
var %nrecs = $bvar(&font, 3).nword, %storepos = $calc(%namepos + $bvar(&font, 5).nword), %i = 1
while (%i <= %nrecs) {
%p = $calc(7 + (%i - 1) * 12)
if ($bvar(&font, %p).nword = 3) && ($bvar(&font, $calc(%p + 6)).nword = %nid) {
var %len = $bvar(&font, $calc(%p + 8)).nword, %peid = $bvar(&font, $calc(%p + 2)).nword
bread %fn $calc(%storepos + $bvar(&font, $calc(%p + 10)).nword) %len &font
return $uni2ansi($bvar(&font, 1, %len))
}
inc %i
}
}
alias uni2ansi {
var %unicode = $1, %i = 1, %t = $numtok(%unicode, 32), %s = i, %c
while (%i <= %t) {
%c = $gettok(%unicode, $+(%i, -, $calc(%i + 2)), 32)
if ($gettok(%c, 1, 32) = 0) { %c = $chr($gettok(%c, 2, 32)) }
else { %c = ? }
%s = $left(%s, -1) $+ %c $+ i
inc %i 2
}
return $left(%s, -1)
}
Edited May 21, 2010 3:48 AM by err0r