4coder/win32_ft_font.cpp

31 lines
803 B
C++
Raw Normal View History

2016-06-20 20:34:48 +00:00
// NOTE(allen): Thanks to insofaras.
// This is copy-pasted from some work he
// did to get free type working on linux.
// Once it is working on both sides it might
// be possible to pull some parts out as
// portable FT rendering.
internal b32
2016-07-03 22:29:07 +00:00
win32_ft_font_load(Partition *part, Render_Font *rf, char *name,
i32 pt_size, i32 tab_width, b32 use_hinting){
2016-06-21 14:00:07 +00:00
2016-06-21 18:13:28 +00:00
b32 result = 0;
2016-06-21 14:00:07 +00:00
Temp_Memory temp = begin_temp_memory(part);
char* filename = push_array(part, char, 256);
2016-06-21 18:13:28 +00:00
if (filename != 0){
String str = make_string(filename, 0, 256);
sysshared_to_binary_path(&str, name);
2016-06-21 14:00:07 +00:00
2016-07-03 22:29:07 +00:00
result = font_load_freetype(part, rf, filename, pt_size, tab_width, use_hinting);
2016-06-20 20:34:48 +00:00
}
2016-06-21 14:00:07 +00:00
end_temp_memory(temp);
2016-06-21 18:13:28 +00:00
return(result);
2016-06-20 20:34:48 +00:00
}
2016-06-21 18:13:28 +00:00