PSPSDK 2026-09-28
Loading...
Searching...
No Matches
Fonts Library

This module contains the imports for fonts. More...

Data Structures

struct  SceFontStyle
 Font style info. More...
 
struct  SceFontCharacterData
 Fixed-point info about singular characters. More...
 
struct  SceFontCharacterDataFloat
 Floating-point info about singular characters. More...
 
struct  SceFontInfo
 General font info. More...
 
struct  SceFontRect
 Rectangular size of the font images. More...
 
struct  SceFontCache
 Font cache data. More...
 
struct  SceFontLibData
 Info about a specific font. More...
 
struct  SceFontImageBuffer
 Buffer of the image containing a font. More...
 
struct  SceFontCharacterInfo
 All the information regarding a single character. More...
 

Typedefs

typedef struct SceFontStyle SceFontStyle
 Font style info.
 
typedef struct SceFontCharacterData SceFontCharacterData
 Fixed-point info about singular characters.
 
typedef struct SceFontCharacterDataFloat SceFontCharacterDataFloat
 Floating-point info about singular characters.
 
typedef struct SceFontInfo SceFontInfo
 General font info.
 
typedef struct SceFontRect SceFontRect
 Rectangular size of the font images.
 
typedef struct SceFontCache SceFontCache
 Font cache data.
 
typedef struct SceFontLibData SceFontLibData
 Info about a specific font.
 
typedef struct SceFontImageBuffer SceFontImageBuffer
 Buffer of the image containing a font.
 
typedef struct SceFontCharacterInfo SceFontCharacterInfo
 All the information regarding a single character.
 

Enumerations

enum  SceFontFamily { SCE_FONT_FAMILY_DEFAULT = 0x0 , SCE_FONT_FAMILY_SANS_SERIF = 0x1 , SCE_FONT_FAMILY_SERIF = 0x2 , SCE_FONT_FAMILY_ROUNDED = 0x3 }
 
enum  SceFontStyles {
  SCE_FONT_STYLE_DEFAULT = 0x0 , SCE_FONT_STYLE_REGULAR = 0x1 , SCE_FONT_STYLE_ITALIC = 0x2 , SCE_FONT_STYLE_THIN = 0x3 ,
  SCE_FONT_STYLE_ITALIC_THIN = 0x4 , SCE_FONT_STYLE_BOLD = 0x5 , SCE_FONT_STYLE_ITALIC_BOLD = 0x6 , SCE_FONT_STYLE_THICK = 0x7 ,
  SCE_FONT_STYLE_ITALIC_THICK = 0x8
}
 
enum  SceFontPixelFormat {
  SCE_FONT_PIXEL_FORMAT_L4 = 0x0 , SCE_FONT_PIXEL_FORMAT_R4 = 0x1 , SCE_FONT_PIXEL_FORMAT_8 = 0x2 , SCE_FONT_PIXEL_FORMAT_24 = 0x3 ,
  SCE_FONT_PIXEL_FORMAT_32 = 0x4
}
 
enum  SceFontLanguage {
  SCE_FONT_LANGUAGE_DEFAULT = 0x0 , SCE_FONT_LANGUAGE_JAPANESE = 0x1 , SCE_FONT_LANGUAGE_ENGLISH = 0x2 , SCE_FONT_LANGUAGE_KOREAN = 0x3 ,
  SCE_FONT_LANGUAGE_CHINESE = 0x4 , SCE_FONT_LANGUAGE_JKC = 0x5
}
 
enum  SceFontVendorCountry { SCE_FONT_VENDOR_COUNTRY_DEFAULT = 0x0 , SCE_FONT_VENDOR_COUNTRY_JAPAN = 0x1 , SCE_FONT_VENDOR_COUNTRY_USA = 0x2 , SCE_FONT_VENDOR_COUNTRY_KOREA = 0x3 }
 

Functions

int sceFontFlush (void *libraryId)
 Flush local font cache.
 
int sceFontFindOptimumFont (void *libraryId, SceFontStyle *fontStyle, int *error)
 Find an optimum font.
 
int sceFontGetFontInfo (void *fontHandle, SceFontInfo *fontInfo)
 Get font info.
 
int sceFontGetNumFontList (void *libraryHandle, int *error)
 Get number of all available font lists.
 
int sceFontCalcMemorySize (void *libraryHandle, SceFontStyle *fontStyle, int *error)
 Calculate required memory size for a font.
 
int sceFontIsElement ()
 
int sceFontClose (void *fontHandle)
 Close the font handle.
 
float sceFontPointToPixelV (void *libraryHandle, float points, int *error)
 Convert units from points to pixels in the vertical direction.
 
float sceFontPointToPixelH (void *libraryHandle, float points, int *error)
 Convert units from points to pixels in the horizontal direction.
 
int sceFontSetResolution (void *libraryHandle, float hres, float vres)
 Set font resolution.
 
int sceFontGetShadowImageRect (void *fontHandle, unsigned short code, SceFontRect *output)
 
int sceFontGetFontInfoByIndexNumber (void *libraryHandle, SceFontStyle *fontStyle, int index)
 Get font style info by index number.
 
int sceFontGetShadowGlyphImage (void *fontHandle, unsigned short code, SceFontImageBuffer *output)
 
int sceFontDoneLib (void *libraryHandle)
 Terminate a font handle.
 
void * sceFontOpenUserFile (void *libraryHandle, char *path, unsigned int mode, int *error)
 Open local font file.
 
int sceFontGetCharImageRect (void *fontHandle, unsigned short code, SceFontRect *output)
 Get size of the image of the character.
 
int sceFontGetShadowGlyphImage_Clip (void *fontHandle, unsigned short code, SceFontImageBuffer *output, int x, int y, unsigned int width, unsigned int height)
 
void * sceFontNewLib (SceFontLibData *data, int *error)
 Initialize a font library.
 
int sceFontFindFont (void *libraryHandle, SceFontStyle *fontStyle, int *error)
 Find the font that exactly matches the style.
 
float sceFontPixelToPointH (void *libraryHandle, float pixels, int *error)
 Convert units from pixels to points in the horizontal direction.
 
int sceFontGetCharGlyphImage (void *fontHandle, unsigned short code, SceFontImageBuffer *output)
 Get image of a character.
 
void * sceFontOpen (void *libraryHandle, int index, unsigned int mode, int *error)
 Open a new font.
 
int sceFontGetShadowInfo (void *fontHandle, unsigned short code, SceFontCharacterInfo *output)
 
void * sceFontOpenUserMemory (void *libraryHandle, char *font, unsigned int size, int *error)
 Open font from memory.
 
int sceFontGetFontList (void *libraryHandle, SceFontStyle *output, int size)
 Get available fonts.
 
int sceFontGetCharGlyphImage_Clip (void *fontHandle, unsigned short code, SceFontImageBuffer *output, int x, int y, unsigned int width, unsigned int height)
 Get clipped image of the character.
 
int sceFontGetCharInfo (void *fontHandle, unsigned short code, SceFontCharacterInfo *output)
 Get info about character.
 
int sceFontSetAltCharacterCode (void *libraryHandle, unsigned short code)
 Set a fallback character.
 
float sceFontPixelToPointV (void *libraryHandle, float pixels, int *error)
 Convert units from pixels to points in the vertical direction.
 

Detailed Description

This module contains the imports for fonts.

Typedef Documentation

◆ SceFontCache

typedef struct SceFontCache SceFontCache

Font cache data.

See also
SceFontLibData

◆ SceFontCharacterData

typedef struct SceFontCharacterData SceFontCharacterData

Fixed-point info about singular characters.

See also
SceFontCharacterData
SceFontCharacterDataFloat
SceFontInfo
SceFontCharacterInfo

◆ SceFontCharacterDataFloat

typedef struct SceFontCharacterDataFloat SceFontCharacterDataFloat

Floating-point info about singular characters.

See also
SceFontCharacterData
SceFontInfo

◆ SceFontCharacterInfo

typedef struct SceFontCharacterInfo SceFontCharacterInfo

All the information regarding a single character.

See also
SceFontCharacterData
sceFontGetShadowInfo()
sceFontGetCharInfo()

◆ SceFontImageBuffer

typedef struct SceFontImageBuffer SceFontImageBuffer

◆ SceFontInfo

typedef struct SceFontInfo SceFontInfo

◆ SceFontLibData

typedef struct SceFontLibData SceFontLibData

Info about a specific font.

See also
SceFontCache
sceFontNewLib()

◆ SceFontRect

typedef struct SceFontRect SceFontRect

Rectangular size of the font images.

See also
SceFontImageBuffer
sceFontGetShadowImageRect()
sceFontGetCharImageRect()

◆ SceFontStyle

Enumeration Type Documentation

◆ SceFontFamily

Enumerator
SCE_FONT_FAMILY_DEFAULT 
SCE_FONT_FAMILY_SANS_SERIF 
SCE_FONT_FAMILY_SERIF 
SCE_FONT_FAMILY_ROUNDED 

◆ SceFontLanguage

Enumerator
SCE_FONT_LANGUAGE_DEFAULT 
SCE_FONT_LANGUAGE_JAPANESE 
SCE_FONT_LANGUAGE_ENGLISH 
SCE_FONT_LANGUAGE_KOREAN 
SCE_FONT_LANGUAGE_CHINESE 
SCE_FONT_LANGUAGE_JKC 

◆ SceFontPixelFormat

Enumerator
SCE_FONT_PIXEL_FORMAT_L4 
SCE_FONT_PIXEL_FORMAT_R4 
SCE_FONT_PIXEL_FORMAT_8 
SCE_FONT_PIXEL_FORMAT_24 
SCE_FONT_PIXEL_FORMAT_32 

◆ SceFontStyles

Enumerator
SCE_FONT_STYLE_DEFAULT 
SCE_FONT_STYLE_REGULAR 
SCE_FONT_STYLE_ITALIC 
SCE_FONT_STYLE_THIN 
SCE_FONT_STYLE_ITALIC_THIN 
SCE_FONT_STYLE_BOLD 
SCE_FONT_STYLE_ITALIC_BOLD 
SCE_FONT_STYLE_THICK 
SCE_FONT_STYLE_ITALIC_THICK 

◆ SceFontVendorCountry

Enumerator
SCE_FONT_VENDOR_COUNTRY_DEFAULT 
SCE_FONT_VENDOR_COUNTRY_JAPAN 
SCE_FONT_VENDOR_COUNTRY_USA 
SCE_FONT_VENDOR_COUNTRY_KOREA 

Function Documentation

◆ sceFontCalcMemorySize()

int sceFontCalcMemorySize ( void * libraryHandle,
SceFontStyle * fontStyle,
int * error )

Calculate required memory size for a font.

Parameters
libraryHandle- Font library handle.
fontStyle- Style for the requested font.
error- Address for an error code.
Returns
Required memory size.

◆ sceFontClose()

int sceFontClose ( void * fontHandle)

Close the font handle.

Parameters
fontHandle- Font handle.
Returns
0 on success, error code otherwise.

◆ sceFontDoneLib()

int sceFontDoneLib ( void * libraryHandle)

Terminate a font handle.

Parameters
libraryHandle- Font library handle.
Returns
0 on success, error code otherwise.

◆ sceFontFindFont()

int sceFontFindFont ( void * libraryHandle,
SceFontStyle * fontStyle,
int * error )

Find the font that exactly matches the style.

Parameters
libraryHandle- Font library handle.
fontStyle- Style for the font to find.
error- Address for an error code.
Returns
Index value of the font, -1 if no font is found, or 0 on error.

◆ sceFontFindOptimumFont()

int sceFontFindOptimumFont ( void * libraryId,
SceFontStyle * fontStyle,
int * error )

Find an optimum font.

Parameters
libraryId- Font handle.
fontStyle- Style data of a wanted font.
error- Address for an error code.
Returns
Index of the optimum font, otherwise 0.

◆ sceFontFlush()

int sceFontFlush ( void * libraryId)

Flush local font cache.

Parameters
libraryId- Font handle.
Returns
0 on success, error code otherwise.

◆ sceFontGetCharGlyphImage()

int sceFontGetCharGlyphImage ( void * fontHandle,
unsigned short code,
SceFontImageBuffer * output )

Get image of a character.

Parameters
fontHandle- Font handle.
code- Character code.
output- Output data.
Returns
0 on success, error code otherwise.

◆ sceFontGetCharGlyphImage_Clip()

int sceFontGetCharGlyphImage_Clip ( void * fontHandle,
unsigned short code,
SceFontImageBuffer * output,
int x,
int y,
unsigned int width,
unsigned int height )

Get clipped image of the character.

Parameters
fontHandle- Font handle.
code- Character code.
output- Output data.
x- X position of clipping.
y- Y position of clipping.
width- Clipping width.
height- Clipping height.
Returns
0 on success, error code otherwise.

◆ sceFontGetCharImageRect()

int sceFontGetCharImageRect ( void * fontHandle,
unsigned short code,
SceFontRect * output )

Get size of the image of the character.

Parameters
fontHandle- Font handle.
code- Character code.
output- Pointer to output with width and size of the image.
Returns
0 on success, error code otherwise.

◆ sceFontGetCharInfo()

int sceFontGetCharInfo ( void * fontHandle,
unsigned short code,
SceFontCharacterInfo * output )

Get info about character.

Parameters
fontHandle- Font handle.
code- Character code.
output- Output of character information.
Returns
0 on success, error code otherwise.

◆ sceFontGetFontInfo()

int sceFontGetFontInfo ( void * fontHandle,
SceFontInfo * fontInfo )

Get font info.

Parameters
fontHandle- Font library handle.
fontInfo- Font information output.
Returns
0 on success, error code otherwise.

◆ sceFontGetFontInfoByIndexNumber()

int sceFontGetFontInfoByIndexNumber ( void * libraryHandle,
SceFontStyle * fontStyle,
int index )

Get font style info by index number.

Parameters
libraryHandle- Font library handle.
fontStyle- Style output.
index- Font index.
Returns
0 on success, error code otherwise.

◆ sceFontGetFontList()

int sceFontGetFontList ( void * libraryHandle,
SceFontStyle * output,
int size )

Get available fonts.

Parameters
libraryHandle- Font library handle.
output- Array of SceFontStyle.
size- Size of the output array.
Returns
0 on success, error code otherwise.

◆ sceFontGetNumFontList()

int sceFontGetNumFontList ( void * libraryHandle,
int * error )

Get number of all available font lists.

Parameters
libraryHandle- Font library handle.
error- Address for an error code.
Returns
Number of available font lists.

◆ sceFontGetShadowGlyphImage()

int sceFontGetShadowGlyphImage ( void * fontHandle,
unsigned short code,
SceFontImageBuffer * output )

◆ sceFontGetShadowGlyphImage_Clip()

int sceFontGetShadowGlyphImage_Clip ( void * fontHandle,
unsigned short code,
SceFontImageBuffer * output,
int x,
int y,
unsigned int width,
unsigned int height )

◆ sceFontGetShadowImageRect()

int sceFontGetShadowImageRect ( void * fontHandle,
unsigned short code,
SceFontRect * output )

◆ sceFontGetShadowInfo()

int sceFontGetShadowInfo ( void * fontHandle,
unsigned short code,
SceFontCharacterInfo * output )

◆ sceFontIsElement()

int sceFontIsElement ( )

◆ sceFontNewLib()

void * sceFontNewLib ( SceFontLibData * data,
int * error )

Initialize a font library.

Parameters
data- Setup for a font library.
error- Address for an error code.
Returns
Font library handle.

◆ sceFontOpen()

void * sceFontOpen ( void * libraryHandle,
int index,
unsigned int mode,
int * error )

Open a new font.

Parameters
libraryHandle- Font library handle.
index- Font index (0 for default).
mode- 0 for file based stream, 1 for memory based stream.
error- Address for an error code.
Returns
Font handle.

◆ sceFontOpenUserFile()

void * sceFontOpenUserFile ( void * libraryHandle,
char * path,
unsigned int mode,
int * error )

Open local font file.

Parameters
libraryHandle- Font library handle.
path- Full path to the font.
mode- 0 for file based stream, 1 for memory based stream.
error- Address for an error code.
Returns
Font handle.

◆ sceFontOpenUserMemory()

void * sceFontOpenUserMemory ( void * libraryHandle,
char * font,
unsigned int size,
int * error )

Open font from memory.

Parameters
libraryHandle- Font library handle.
font- Pointer to font in memory.
size- Size of the font data.
error- Address for an error code.
Returns
Font handle.

◆ sceFontPixelToPointH()

float sceFontPixelToPointH ( void * libraryHandle,
float pixels,
int * error )

Convert units from pixels to points in the horizontal direction.

Parameters
libraryHandle- Font library handle.
pixels- Pixels value to convert.
error- Address for an error code.
Returns
Points units.

◆ sceFontPixelToPointV()

float sceFontPixelToPointV ( void * libraryHandle,
float pixels,
int * error )

Convert units from pixels to points in the vertical direction.

Parameters
libraryHandle- Font library handle.
pixels- Pixels value to convert.
error- Address for an error code.
Returns
Points units.

◆ sceFontPointToPixelH()

float sceFontPointToPixelH ( void * libraryHandle,
float points,
int * error )

Convert units from points to pixels in the horizontal direction.

Parameters
libraryHandle- Font library handle.
points- Points value to convert.
error- Address for an error code.
Returns
Pixels units.

◆ sceFontPointToPixelV()

float sceFontPointToPixelV ( void * libraryHandle,
float points,
int * error )

Convert units from points to pixels in the vertical direction.

Parameters
libraryHandle- Font library handle.
points- Points value to convert.
error- Address for an error code.
Returns
Pixels units.

◆ sceFontSetAltCharacterCode()

int sceFontSetAltCharacterCode ( void * libraryHandle,
unsigned short code )

Set a fallback character.

Parameters
libraryHandle- Font library handle.
code- Character code.
Returns
0 on success, error code otherwise.

◆ sceFontSetResolution()

int sceFontSetResolution ( void * libraryHandle,
float hres,
float vres )

Set font resolution.

Parameters
libraryHandle- Font library handle.
hres- Horizontal resolution.
vres- Vertical resolution.
Returns
0 on success, error code otherwise.