Just as I wrote it in the PM. It is not absolutely necessary to write a plugin for it. This can be written just as well in Tier 1.
Here I give an approach. It only reads the name. To read more information from the ttf file you have to familiarize yourself with the ttf-format in order to know which information can be found where.
Here is the link to the MS page.
// Project: ttf.agc
// Created: 2017-08-15
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "ttf.agc" )
SetWindowSize( 1024, 768, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( 1024, 768 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 30, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts
Type TT_Offset_Table
uMajorVersion As Integer
uMinorVersion As Integer
uNumOfTables As Integer
uSearchRange As Integer
uEntrySelector As Integer
uRangeShift As Integer
EndType
Type TT_Record_Table
szTag As String //table name
uCheckSum As Integer //Check sum
uOffset As Integer //Offset from beginning of file
uLength As Integer //length of the table in bytes
EndType
Type TT_Naming_Table_Header0
uFSelector As Integer //format selector. Always 0
uNRCount As Integer //Name Records count
uStorageOffset As Integer //Offset for strings storage, from start of the table
EndType
Type TT_Name_Record
uPlatformID As Integer
uEncodingID As Integer
uLanguageID As Integer
uNameID As Integer
uStringLength As Integer
uStringOffset As Integer //from start of storage area
EndType
Type MyTTF_Type
szName As String
iItalic As Integer
iBold As Integer
iUnderline As Integer
EndType
Function ReadBigEndianShort(FileID As Integer)
out As Integer
out = ReadByte (FileID) * 256
Inc out, ReadByte (FileID)
EndFunction out
Function ReadBigEndianLong(FileID As Integer)
out As Integer
out = ReadByte (FileID) * 16777216
Inc out, ReadByte (FileID) * 65536
Inc out, ReadByte (FileID) * 256
Inc out, ReadByte (FileID)
EndFunction out
Function ReadChars(FileID as Integer, length As Integer)
out As String
count As Integer
For count = 1 To length
out = out + Chr(ReadByte(FileID))
Next
EndFunction out
Function ReadTTF_Header(fi as Integer, header Ref As TT_Offset_Table)
header.uMajorVersion = ReadBigEndianShort(fi)
header.uMinorVersion = ReadBigEndianShort(fi)
header.uNumOfTables = ReadBigEndianShort(fi)
header.uSearchRange = ReadBigEndianShort(fi)
header.uEntrySelector = ReadBigEndianShort(fi)
header.uRangeShift = ReadBigEndianShort(fi)
EndFunction
Function ReadTTF_Records(fi as Integer, record Ref As TT_Record_Table)
record.szTag = ReadChars(fi, 4)
record.uCheckSum = ReadBigEndianLong(fi)
record.uOffset = ReadBigEndianLong(fi)
record.uLength = ReadBigEndianLong(fi)
EndFunction
Function ReadTTF_NameHeader0(fi As Integer, header Ref As TT_Naming_Table_Header0)
header.uFSelector = ReadBigEndianShort(fi)
header.uNRCount = ReadBigEndianShort(fi)
header.uStorageOffset = ReadBigEndianShort(fi)
EndFunction
Function ReadTTF_NameRecord(fi As Integer, record Ref As TT_Name_Record)
record.uPlatformID = ReadBigEndianShort(fi)
record.uEncodingID = ReadBigEndianShort(fi)
record.uLanguageID = ReadBigEndianShort(fi)
record.uNameID = ReadBigEndianShort(fi)
record.uStringLength = ReadBigEndianShort(fi)
record.uStringOffset = ReadBigEndianShort(fi)
EndFunction
Function ReadTTF(file As String)
out As MyTTF_Type
fi As Integer
fi = OpenToRead (file)
ttfHeader As TT_Offset_Table
ReadTTF_Header (fi, ttfHeader)
ttfTableRecords As TT_Record_Table
ttfNameTableHeader as TT_Naming_Table_Header0
ttfNameRecord as TT_Name_Record
count As Integer
For count = 1 To ttfHeader.uNumOfTables
ReadTTF_Records (fi, ttfTableRecords)
If ttfTableRecords.szTag = "name"
SetFilePos(fi, ttfTableRecords.uOffset)
ReadTTF_NameHeader0(fi, ttfNameTableHeader)
count2 as Integer
For count2 = 1 To ttfNameTableHeader.uNRCount
ReadTTF_NameRecord(fi, ttfNameRecord)
If ttfNameRecord.uNameID = 1 Or ttfNameRecord.uNameID = 16
pos As Integer
oldpos As Integer
pos = ttfTableRecords.uOffset + ttfNameTableHeader.uStorageOffset + ttfNameRecord.uStringOffset
oldpos = GetFilePos(fi)
SetFilePos(fi, pos)
out.szName = ReadChars(fi, ttfNameRecord.uStringLength)
Endif
If Len(out.szName) > 0 Then Exit
Next
SetFilePos(fi, oldpos)
EndIF
Next
EndFunction out
ttf as MyTTF_Type
ttf = ReadTTF("raw:C:/Windows/Fonts/ahronbd.ttf")
do
print(ttf.szName)
Print( ScreenFPS() )
Sync()
loop