widget.fonts.info
local info = require "widget.fonts.info"
__index
(field) __index: core.object
Base class providing OOP functionality for Lua. All classes in Pragtical inherit from Object.
data
(field) data: widget.fonts.data[]
Holds the metadata for each of the embedded fonts
last_error
(field) last_error: string
path
(field) path: string
Path of the font file
reader
(field) reader: widget.fonts.reader
super
(field) super: core.object
Base class providing OOP functionality for Lua. All classes in Pragtical inherit from Object.
widget.fonts.cdata
__index
(field) __index: core.object
Base class providing OOP functionality for Lua. All classes in Pragtical inherit from Object.
data
(field) data: string
position
(field) position: integer
super
(field) super: core.object
Base class providing OOP functionality for Lua. All classes in Pragtical inherit from Object.
__call
(method) core.object:__call(...any)
-> obj: core.object
Metamethod allowing class to be called like a constructor.
Enables syntax: local obj = MyClass(args) instead of MyClass:new(args)
Automatically creates instance and calls new() with provided arguments.
@return obj — The new instance of the class
__tostring
(method) widget.fonts.cdata:__tostring()
-> string
extend
(method) core.object:extend()
-> cls: core.object
Create a new class that inherits from this one.
Returns a new class with this class as its parent.
Example: local MyClass = Object:extend()
@return cls — The new class table
extends
(method) core.object:extends(T: any)
-> extends: boolean
Check if object inherits from the given type (inheritance-aware).
Use this to check class hierarchy.
Example: view:extends(View) returns true for View and all subclasses
@param T — Class to check inheritance from
@return extends — True if object is T or inherits from T
is
(method) core.object:is(T: any)
-> is_exact: boolean
Check if object is exactly of the given type (no inheritance check).
Use this for strict type matching.
Example: view:is(DocView) returns true only if view is a DocView, not a subclass
@param T — Class to check against
@return is_exact — True if object is exactly type T
is_class_of
(method) core.object:is_class_of(T: any)
-> is_instance: boolean
Check if the given object is exactly an instance of this class.
Inverse of is() - checks if T is an instance of self.
Example: DocView:is_class_of(obj) checks if obj is exactly a DocView
@param T — Object to check
@return is_instance — True if T is exactly an instance of this class
is_extended_by
(method) core.object:is_extended_by(T: any)
-> is_extended: boolean
Check if the given object/class inherits from this class.
Inverse of extends() - checks if T is a subclass of self.
Example: View:is_extended_by(DocView) checks if DocView inherits from View
@param T — Object or class to check
@return is_extended — True if T inherits from this class
new
(method) widget.fonts.cdata:new(data: any)
FontCDATA Implementation
pos
(method) widget.fonts.cdata:pos(p: any)
-> integer|widget.fonts.cdata
setstr
(method) widget.fonts.cdata:setstr(s: any)
-> widget.fonts.cdata
setulong
(method) widget.fonts.cdata:setulong(v: any)
-> widget.fonts.cdata
setunum
(method) widget.fonts.cdata:setunum(b: any, v: any)
-> widget.fonts.cdata
str
(method) widget.fonts.cdata:str(b: any)
-> string
ulong
(method) widget.fonts.cdata:ulong()
-> unknown
ulongs
(method) widget.fonts.cdata:ulongs(num: any)
-> table
unum
(method) widget.fonts.cdata:unum(b: any)
-> unknown
ushort
(method) widget.fonts.cdata:ushort()
-> unknown
widget.fonts.data
copyright
(field) copyright: string
family
(field) family: string
fullname
(field) fullname: string
id
(field) id: number
Numerical id of the font
license
(field) license: string
monospace
(field) monospace: boolean
path
(field) path: string
psname
(field) psname: string
subfamily
(field) subfamily: "Bold Italic"|"Bold"|"Italic"|"Regular"
tfamily
(field) tfamily: string
tsubfamily
(field) tsubfamily: "Bold Italic"|"Bold"|"Italic"|"Regular"
type
(field) type: "otf"|"ttc"|"ttf"
url
(field) url: string
version
(field) version: string
wwsfamily
(field) wwsfamily: string
wwssubfamily
(field) wwssubfamily: string
widget.fonts.reader
__index
(field) __index: core.object
Base class providing OOP functionality for Lua. All classes in Pragtical inherit from Object.
file
(field) file: file*
[View documents](command:extension.lua.doc?["en-us/54/manual.html/pdf-file"])
path
(field) path: string
super
(field) super: core.object
Base class providing OOP functionality for Lua. All classes in Pragtical inherit from Object.
__call
(method) core.object:__call(...any)
-> obj: core.object
Metamethod allowing class to be called like a constructor.
Enables syntax: local obj = MyClass(args) instead of MyClass:new(args)
Automatically creates instance and calls new() with provided arguments.
@return obj — The new instance of the class
__gc
(method) widget.fonts.reader:__gc()
__tostring
(method) widget.fonts.reader:__tostring()
-> string
cdata
(method) widget.fonts.reader:cdata(offset: integer, len: integer)
-> (widget.fonts.cdata)?
2. errmsg: string|nil
close
(method) widget.fonts.reader:close()
extend
(method) core.object:extend()
-> cls: core.object
Create a new class that inherits from this one.
Returns a new class with this class as its parent.
Example: local MyClass = Object:extend()
@return cls — The new class table
extends
(method) core.object:extends(T: any)
-> extends: boolean
Check if object inherits from the given type (inheritance-aware).
Use this to check class hierarchy.
Example: view:extends(View) returns true for View and all subclasses
@param T — Class to check inheritance from
@return extends — True if object is T or inherits from T
is
(method) core.object:is(T: any)
-> is_exact: boolean
Check if object is exactly of the given type (no inheritance check).
Use this for strict type matching.
Example: view:is(DocView) returns true only if view is a DocView, not a subclass
@param T — Class to check against
@return is_exact — True if object is exactly type T
is_class_of
(method) core.object:is_class_of(T: any)
-> is_instance: boolean
Check if the given object is exactly an instance of this class.
Inverse of is() - checks if T is an instance of self.
Example: DocView:is_class_of(obj) checks if obj is exactly a DocView
@param T — Object to check
@return is_instance — True if T is exactly an instance of this class
is_extended_by
(method) core.object:is_extended_by(T: any)
-> is_extended: boolean
Check if the given object/class inherits from this class.
Inverse of extends() - checks if T is a subclass of self.
Example: View:is_extended_by(DocView) checks if DocView inherits from View
@param T — Object or class to check
@return is_extended — True if T inherits from this class
new
(method) widget.fonts.reader:new(font_path: any)
FontReader Implementation
read
(method) widget.fonts.reader:read(offset: any, len: any)
-> unknown|nil
2. string|nil
widget.fonts.style
widget.fonts.style:
-\> "regular"
| "bold"
| "italic"
| "bold italic"
| "thin"
| "medium"
| "light"
| "black"
| "condensed"
| "oblique"
| "bold oblique"
| "extra nold"
| "Extra bold italic"
| "bold condensed"
check_is_monospace
function widget.fonts.info.check_is_monospace(font_data: widget.fonts.data)
-> checked: boolean
2. errmsg: string?
Helper function to check and update a font monospace attribute.
__call
(method) core.object:__call(...any)
-> obj: core.object
Metamethod allowing class to be called like a constructor.
Enables syntax: local obj = MyClass(args) instead of MyClass:new(args)
Automatically creates instance and calls new() with provided arguments.
@return obj — The new instance of the class
__tostring
(method) core.object:__tostring()
-> str: string
Get string representation of the object (for debugging/logging).
Override in subclasses to provide meaningful names.
Example: function MyClass:__tostring() return "MyClass" end
@return str — String representation (default: "Object")
embedded_fonts_count
(method) widget.fonts.info:embedded_fonts_count()
-> integer
Get the amount of collections on the font file.
extend
(method) core.object:extend()
-> cls: core.object
Create a new class that inherits from this one.
Returns a new class with this class as its parent.
Example: local MyClass = Object:extend()
@return cls — The new class table
extends
(method) core.object:extends(T: any)
-> extends: boolean
Check if object inherits from the given type (inheritance-aware).
Use this to check class hierarchy.
Example: view:extends(View) returns true for View and all subclasses
@param T — Class to check inheritance from
@return extends — True if object is T or inherits from T
get_data
(method) widget.fonts.info:get_data(idx?: integer)
-> (widget.fonts.data)?
2. errmsg: string|nil
Get the metadata of a previously read font file without copyright and license information which can be long.
@param idx — Optional position of the embedded font
is
(method) core.object:is(T: any)
-> is_exact: boolean
Check if object is exactly of the given type (no inheritance check).
Use this for strict type matching.
Example: view:is(DocView) returns true only if view is a DocView, not a subclass
@param T — Class to check against
@return is_exact — True if object is exactly type T
is_class_of
(method) core.object:is_class_of(T: any)
-> is_instance: boolean
Check if the given object is exactly an instance of this class.
Inverse of is() - checks if T is an instance of self.
Example: DocView:is_class_of(obj) checks if obj is exactly a DocView
@param T — Object to check
@return is_instance — True if T is exactly an instance of this class
is_extended_by
(method) core.object:is_extended_by(T: any)
-> is_extended: boolean
Check if the given object/class inherits from this class.
Inverse of extends() - checks if T is a subclass of self.
Example: View:is_extended_by(DocView) checks if DocView inherits from View
@param T — Object or class to check
@return is_extended — True if T inherits from this class
new
(method) widget.fonts.info:new(font_path?: string)
Constructor
read
(method) widget.fonts.info:read(font_path: string)
-> (widget.fonts.info)?
2. errmsg: string|nil
Open a font file and read its metadata.