static void *vita2d_font_init_font(void *gl_data, const char *font_path, float font_size) { RARCH_LOG("vita2d_font_init()\n"); vita_font_t *vita = (vita_font_t *)calloc(1, sizeof(vita_font_t)); vita->font = vita2d_load_font_mem(stockfont,stockfont_size); vita->size = font_size; RARCH_LOG("vita2d_font_init()\n"); return vita; }
inline int PutChar(PspFont *font, int sx, int sy, unsigned char sym, int color) { if(!font->font){ font->font=vita2d_load_font_mem(stockfont,stockfont_size); font->Height=pspFontGetLineHeight(font); font->Ascent=font->Height; } /* Instead of a tab, skip 4 spaces */ if (sym == (uint8_t)'\t') return pspFontGetTextWidth(font," ") * 4; /* This function should be rewritten to write directly to VRAM, probably */ char buf[2]; buf[0]=sym; buf[1]='\0'; int w = vita2d_font_draw_text(font->font,sx+1,sy+1,PSP_COLOR_BLACK,PSP_FONT_SIZE,buf); w = vita2d_font_draw_text(font->font,sx,sy,color,PSP_FONT_SIZE,buf); return w; }