AERMRE 1.5.1
AER modding framework for Hyper Light Drifter.
font.h File Reference

Utilities for querying and manipulating fonts. More...

Go to the source code of this file.

Enumerations

enum  AERFontIndex {
  AER_FONT_NULL = -1 , AER_FONT_ARIAL = 0x0 , AER_FONT_UNI = 0x1 , AER_FONT_CYR = 0x2 ,
  AER_FONT_JP = 0x3 , AER_FONT_EDITORSMALL = 0x4 , AER_FONT_EDITOR = 0x5 , AER_FONT_IMAGINE = 0x6
}
 Vanilla fonts. More...
 

Functions

int32_t AERFontGetCurrent (void)
 Query the currently active font. More...
 
void AERFontSetCurrent (int32_t fontIdx)
 Change the currently active font to a new one. More...
 
int32_t AERFontRegister (const char *filename, size_t size, bool bold, bool italic, int32_t first, int32_t last)
 Register a custom font. More...
 
size_t AERFontGetNumRegistered (void)
 Query the total number of vanilla and mod fonts registered. More...
 
const char * AERFontGetName (int32_t fontIdx)
 Query the name of a font. More...
 
size_t AERFontGetSize (int32_t fontIdx)
 Query the size of a font in pixels. More...
 
bool AERFontGetBold (int32_t fontIdx)
 Query whether a font is bold. More...
 
bool AERFontGetItalic (int32_t fontIdx)
 Query whether a font is italic. More...
 
int32_t AERFontGetFirst (int32_t fontIdx)
 Query the index of the first character in a font. More...
 
int32_t AERFontGetLast (int32_t fontIdx)
 Query the index of the last character in a font. More...
 

Detailed Description

Utilities for querying and manipulating fonts.

Since
1.1.0

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Enumeration Type Documentation

◆ AERFontIndex

Vanilla fonts.

Since
1.1.0
Enumerator
AER_FONT_NULL 

Flag which represents either no font or an invalid font depending on context.

Function Documentation

◆ AERFontGetBold()

bool AERFontGetBold ( int32_t  fontIdx)

Query whether a font is bold.

Parameters
[in]fontIdxFont of interest.
Returns
Whether font is bold or false if unsuccessful.
Exceptions
AER_SEQ_BREAKif called before start of font registration stage.
AER_FAILED_LOOKUPif argument fontIdx is an invalid font.
Since
1.1.0

◆ AERFontGetCurrent()

int32_t AERFontGetCurrent ( void  )

Query the currently active font.

Returns
Index of current font or AER_FONT_NULL if unsuccessful.
Exceptions
AER_SEQ_BREAKif called outside action stage.
Since
1.1.0

◆ AERFontGetFirst()

int32_t AERFontGetFirst ( int32_t  fontIdx)

Query the index of the first character in a font.

Parameters
[in]fontIdxFont of interest.
Returns
Index of first character or -1 if unsuccessful.
Exceptions
AER_SEQ_BREAKif called before start of font registration stage.
AER_FAILED_LOOKUPif argument fontIdx is an invalid font.
Since
1.1.0

◆ AERFontGetItalic()

bool AERFontGetItalic ( int32_t  fontIdx)

Query whether a font is italic.

Parameters
[in]fontIdxFont of interest.
Returns
Whether font is italic or false if unsuccessful.
Exceptions
AER_SEQ_BREAKif called before start of font registration stage.
AER_FAILED_LOOKUPif argument fontIdx is an invalid font.
Since
1.1.0

◆ AERFontGetLast()

int32_t AERFontGetLast ( int32_t  fontIdx)

Query the index of the last character in a font.

Parameters
[in]fontIdxFont of interest.
Returns
Index of last character or -1 if unsuccessful.
Exceptions
AER_SEQ_BREAKif called before start of font registration stage.
AER_FAILED_LOOKUPif argument fontIdx is an invalid font.
Since
1.1.0

◆ AERFontGetName()

const char * AERFontGetName ( int32_t  fontIdx)

Query the name of a font.

Parameters
[in]fontIdxFont of interest.
Returns
Name of font or NULL if unsuccessful.
Exceptions
AER_SEQ_BREAKif called before start of font registration stage.
AER_FAILED_LOOKUPif argument fontIdx is an invalid font.
Since
1.1.0

◆ AERFontGetNumRegistered()

size_t AERFontGetNumRegistered ( void  )

Query the total number of vanilla and mod fonts registered.

Returns
Number of fonts or 0 if unsuccessful.
Exceptions
AER_SEQ_BREAKif called before start of font registration stage.
Since
1.1.0

◆ AERFontGetSize()

size_t AERFontGetSize ( int32_t  fontIdx)

Query the size of a font in pixels.

Parameters
[in]fontIdxFont of interest.
Returns
Pixel size of font or 0 if unsuccessful.
Exceptions
AER_SEQ_BREAKif called before start of font registration stage.
AER_FAILED_LOOKUPif argument fontIdx is an invalid font.
Since
1.1.0

◆ AERFontRegister()

int32_t AERFontRegister ( const char *  filename,
size_t  size,
bool  bold,
bool  italic,
int32_t  first,
int32_t  last 
)

Register a custom font.

Note
This function only supports the TrueType font format (*.ttf).
Parameters
[in]filenamePath to font file relative to asset directory.
[in]sizePixel size of font.
[in]boldWhether font is bold.
[in]italicWhether font is italic.
[in]firstIndex of first font character to include.
[in]lastIndex of last font character to include.
Returns
Index of new font or AER_FONT_NULL if unsuccessful.
Exceptions
AER_NULL_ARGif argument filename is NULL.
AER_SEQ_BREAKif called outside font registration stage.
AER_BAD_FILEif argument filename does not point to valid file.
Since
1.1.0

◆ AERFontSetCurrent()

void AERFontSetCurrent ( int32_t  fontIdx)

Change the currently active font to a new one.

Parameters
[in]fontIdxIndex of new font.
Exceptions
AER_SEQ_BREAKif called outside action stage.
AER_FAILED_LOOKUPif argument fontIdx is an invalid font.
Since
1.1.0