XenevaOS
Loading...
Searching...
No Matches
Functions
font.cpp File Reference
#include "font.h"
#include <sys\mman.h>
#include <sys\_kefile.h>
#include <stdlib.h>
#include "ttf.h"
#include <sys\_keftmngr.h>
#include <ft2build.h>
#include "draw.h"
#include "color.h"
Include dependency graph for font.cpp:

Functions

ChFontChInitialiseFont (char *fontname)
 
void ChFontSetSize (ChFont *font, int size)
 
void ChFontDrawText (ChCanvas *canv, ChFont *font, char *string, int penx, int peny, uint32_t sz, uint32_t color)
 
void ChFontDrawChar (ChCanvas *canv, ChFont *font, char c, int penx, int peny, uint32_t sz, uint32_t color)
 
void ChFontDrawCharClipped (ChCanvas *canv, ChFont *font, char c, int penx, int peny, uint32_t color, ChRect *limit)
 
int64_t ChFontGetWidth (ChFont *font, char *string)
 
int64_t ChFontGetWidthChar (ChFont *font, char c)
 
int64_t ChFontGetHeight (ChFont *font, char *string)
 
int64_t ChFontGetHeightChar (ChFont *font, char c)
 
int ChFontClamp (int val, int min, int max)
 
int ChFontDrawTextClipped (ChCanvas *canv, ChFont *font, char *string, int penx, int peny, uint32_t color, ChRect *limit)
 
int ChFontClose (ChFont *font)
 

Function Documentation

◆ ChFontClamp()

int ChFontClamp ( int  val,
int  min,
int  max 
)

◆ ChFontClose()

int ChFontClose ( ChFont font)

◆ ChFontDrawChar()

void ChFontDrawChar ( ChCanvas canv,
ChFont font,
char  c,
int  penx,
int  peny,
uint32_t  sz,
uint32_t  color 
)

◆ ChFontDrawCharClipped()

void ChFontDrawCharClipped ( ChCanvas canv,
ChFont font,
char  c,
int  penx,
int  peny,
uint32_t  color,
ChRect limit 
)

◆ ChFontDrawText()

void ChFontDrawText ( ChCanvas canv,
ChFont font,
char *  string,
int  penx,
int  peny,
uint32_t  sz,
uint32_t  color 
)

◆ ChFontDrawTextClipped()

int ChFontDrawTextClipped ( ChCanvas canv,
ChFont font,
char *  string,
int  penx,
int  peny,
uint32_t  color,
ChRect limit 
)

◆ ChFontGetHeight()

int64_t ChFontGetHeight ( ChFont font,
char *  string 
)

◆ ChFontGetHeightChar()

int64_t ChFontGetHeightChar ( ChFont font,
char  c 
)

◆ ChFontGetWidth()

int64_t ChFontGetWidth ( ChFont font,
char *  string 
)

◆ ChFontGetWidthChar()

int64_t ChFontGetWidthChar ( ChFont font,
char  c 
)

◆ ChFontSetSize()

void ChFontSetSize ( ChFont font,
int  size 
)

◆ ChInitialiseFont()

ChFont * ChInitialiseFont ( char *  fontname)

BSD 2-Clause License

Copyright (c) 2022-2023, Manas Kamal Choudhury All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.