It would probably compile without errors, but it just wouldn't map to the "DOCUMENTS" folder as you intended, which would be required on the iPad / iPhone. It would map to your default directory, with the file name "save_config$".
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts MenuGLOBAL _Fonts[] AS TFont
CONSTANT FILE_MODE_READ = 1
TYPE TFontChar
xy AS TPoint // x,y position of character in font texture
size AS TSize // Size (w,h) of character
offset AS TPoint // x,y offset amount when drawing character
xadvance% // Move this many pixels left to draw next character, don't use character width
ENDTYPE
TYPE TFont
id% // ID of this font definition
sprite_id% // The sprite that holds this font texture
sprite_size AS TSize // Width / Height of font texture
spacing%
height% // General height of a font character
chars[] AS TFontChar
ENDTYPE
FUNCTION Font_New%: fn$, font_id%, height%, spacing%
CONSTANT PATH$ = "Graphics/Fonts/" // Path to 'Fonts' folder
LOCAL fh% // File Handle
LOCAL font AS TFont // Temporary 'TFont' type
LOCAL ascii% // Ascii value of current character
LOCAL line$ // Current line data from '.fnt' file
DEBUG ">Font_New: " + fn$ + ", id:" + font_id + "\n"
font.id = font_id // Unique id to reference this font for drawing
font.sprite_id = Sprite_Load(PATH$ + fn$ + "_0.png") // Load font texture sprite
font.spacing = spacing // Default spacing between characters
font.height = height // If you want a general line height (and not calculated)
Sprite_GetSize(font.sprite_id, font.sprite_size) // Get font texture width, height
DIM font.chars[ASCII_MAX + 1] // Initialize character array
// --------------------------------------------------------------------
// PARSE ".FNT" FILE
// --------------------------------------------------------------------
fh = GENFILE() // Get available file handle
IF OPENFILE(fh, PATH$ + fn$ + ".fnt", FILE_MODE_READ) = FALSE // Open font's '.fnt' file
RETURN FALSE // Exit and return 'FALSE' if can't open
ENDIF
// First 4 lines aren't needed
READLINE fh, line$
READLINE fh, line$
READLINE fh, line$
READLINE fh, line$
// Read and parse character data from file
WHILE ENDOFFILE(fh) = FALSE
READLINE fh, line$ // Read next line of data for the next character
IF LEN(line$) <= 0 THEN BREAK // End of the character data (skip any kerning data)
IF MID$(line$, 0, 4) <> "char" THEN GOTO SKIP // Character data begins with 'char', skip to next line
ascii = MID$(line$, 8, 3) // Ascii value
IF (ascii < 0) OR (ascii > ASCII_MAX) THEN GOTO SKIP // Ascii value is out of range, skip to next line
font.chars[ascii].xy.x = MID$(line$, 15, 4) // [X Position]
font.chars[ascii].xy.y = MID$(line$, 23, 4) // [Y Position]
font.chars[ascii].size.w = MID$(line$, 35, 4) // [Width]
font.chars[ascii].size.h = MID$(line$, 48, 4) // [Height]
font.chars[ascii].offset.x = MID$(line$, 62, 4) // [X Offset]
font.chars[ascii].offset.y = MID$(line$, 76, 4) // [Y Offset]
font.chars[ascii].xadvance = MID$(line$, 91, 4) // [X Advance]
SKIP:
WEND
CLOSEFILE fh // Close '.fnt' file
//Debug_Font(font)
DIMPUSH _Fonts[], font // Add new font definition to global font list
RETURN TRUE // Font added successfully
ENDFUNCTION
DEBUG test + " " + test2 + "\n"