Lua API
  • 🔎Overview
  • Introduction
    • 🚀Creating scripts
      • 🧠First Steps
      • đŸ–Ĩī¸Adding UI
      • 📚Creating Libraries
  • API
    • 🌐Global Functions
    • âš™ī¸Instances
      • đŸ”ĸMath
      • â˜Žī¸Events
        • event_t
      • 🎮Game
        • global_vars_t
        • cengine_client
          • cnet_chan
        • ccsgo_input
        • cinput_system
        • cgame_ui_funcs
        • ccvar
          • convar
      • đŸ•šī¸Mods
        • events_t
      • âœī¸Draw
        • âš™ī¸Types
          • âš™ī¸rect
          • âš™ī¸vec2
          • âš™ī¸color
          • âš™ī¸accessor
        • đŸ–Ĩī¸Adapter
        • âœī¸Layer
          • outline_mode
          • rounding
          • glow_parts
          • text_params
            • text_alignment
          • shadow_dir
          • command
            • render_mode
        • đŸ–ŧī¸Managed
          • đŸ–ŧī¸texture
            • svg_texture
            • animated_texture
          • đŸ–ŧī¸shader
          • â„ĸī¸font_base
            • font
            • font_gdi
            • glyph_t
            • font_flags
      • 🙋Entities
        • entity_list_t
          • entity_entry_t
        • base_entity
          • schema_accessor_t
          • cs2_weapon_base_gun
          • cs2_player_pawn
          • cs2_player_controller
          • cs2_weapon_base
          • cs2_grenade_projectile
        • ccsweapon_base_vdata
          • cfiring_mode
        • chandle
        • csweapon_mode
        • csweapon_type
        • weapon_id
        • csweapon_category
        • observer_mode_t
      • đŸ–Ĩī¸Gui
        • âš™ī¸Types
          • âš™ī¸bits
          • âš™ī¸control_id
        • context
          • user_t
        • context_input
          • mouse_button
        • notification_system
          • notification
        • control
          • control_type
          • value_param
          • checkbox
          • slider
          • label
          • selectable
          • button
          • color_picker
          • spacer
          • text_input
          • combo_box
          • image
        • container
          • control_container
            • layout
            • group
      • âš™ī¸Utils
    • âš™ī¸Types
      • âš™ī¸ptr
      • âš™ī¸ref_holder_t
      • âš™ī¸vector
      • âš™ī¸vector4d
      • 🎮veccolor
      • 🎮color
      • 🎮cview_setup
      • 🎮cuser_cmd
      • 🎮game_event_t
    • 🟰Enums
      • 🟰client_frame_stage
      • 🟰input_bit_mask
Powered by GitBook

Š 2025 - FATALITY

On this page
Export as PDF
  1. API
  2. Instances
  3. Draw
  4. Managed
  5. font_base

font

Previousfont_baseNextfont_gdi

Last updated 3 months ago

This type represents a font object. Internally, this type uses FreeType library to rasterize font glyphs.

This type inherits type. All of its base methods and fields are also available in this type.

__callīģŋ

Constructs a font object.

Passing an invalid pointer, a or memory region that is smaller than the size will result in a crash.

Arguments

1. From file.

Name

Type

Description

path

string

Path to a ttf/otf file.

size

float

Font height, in pixels.

fl

Font flags. Use bit library to construct them. Defaults to 0.

mi

int

Starting codepoint. Defaults to 0.

ma

int

Ending codepoint. Defaults to 255 (entire ASCII code page).

1. From memory.

Name

Type

Description

mem

Pointer to a font file in memory.

sz

int

Font file size, in bytes.

size

float

Font height, in pixels.

fl

Font flags. Use bit library to construct them. Defaults to 0.

mi

int

Starting codepoint. Defaults to 0.

ma

int

Ending codepoint. Defaults to 255 (entire ASCII code page).

1. From memory, with codepoint pairs.

Name

Type

Description

mem

Pointer to a font file in memory.

sz

int

Font file size, in bytes.

size

float

Font height, in pixels.

fl

Font flags. Use bit library to construct them. Defaults to 0.

pairs

table[{int, int}...]

Min/max pairs. This is a standard array, consisting of {int, int} pairs.

Returns

Type

Description

font

Font object.

Example

local cool_font = draw.font('myfont.ttf', 16);

âš™ī¸
âœī¸
đŸ–ŧī¸
â„ĸī¸
font_base
font_flags
ptr
font_flags
ptr
font_flags