Cleanup: rename "filename" -> "filepath" for full path names

This commit is contained in:
Campbell Barton
2024-06-11 20:45:01 +10:00
parent bdbd6598ad
commit 67c1fbdbb2
4 changed files with 9 additions and 9 deletions

View File

@@ -300,7 +300,7 @@ void BLF_draw_buffer(int fontid, const char *str, size_t str_len, ResultBLF *r_i
*
* \note called from a thread, so it bypasses the normal BLF_* api (which isn't thread-safe).
*/
bool BLF_thumb_preview(const char *filename, unsigned char *buf, int w, int h, int channels)
bool BLF_thumb_preview(const char *filepath, unsigned char *buf, int w, int h, int channels)
ATTR_NONNULL();
/* `blf_default.cc` */

View File

@@ -305,7 +305,7 @@ static const char32_t *blf_get_sample_text(FT_Face face)
return sample;
}
bool BLF_thumb_preview(const char *filename, uchar *buf, int w, int h, int /*channels*/)
bool BLF_thumb_preview(const char *filepath, uchar *buf, int w, int h, int /*channels*/)
{
/* Use own FT_Library and direct FreeType calls as this is called from multiple threads. */
FT_Library ft_lib = nullptr;
@@ -314,7 +314,7 @@ bool BLF_thumb_preview(const char *filename, uchar *buf, int w, int h, int /*cha
}
FT_Face face;
if (FT_New_Face(ft_lib, filename, 0, &face) != FT_Err_Ok) {
if (FT_New_Face(ft_lib, filepath, 0, &face) != FT_Err_Ok) {
FT_Done_FreeType(ft_lib);
return false;
}

View File

@@ -88,10 +88,10 @@ ImBuf *IMB_thumb_load_blend(const char *blen_path, const char *blen_group, const
/**
* Special function for previewing fonts.
*/
ImBuf *IMB_thumb_load_font(const char *filename, unsigned int x, unsigned int y);
ImBuf *IMB_thumb_load_font(const char *filepath, unsigned int x, unsigned int y);
bool IMB_thumb_load_font_get_hash(char *r_hash);
ImBuf *IMB_font_preview(const char *filename, unsigned int width, const float color[4]);
ImBuf *IMB_font_preview(const char *filepath, unsigned int width, const float color[4]);
/* Threading */

View File

@@ -20,7 +20,7 @@
/* Only change if we need to update the previews in the on-disk cache. */
#define FONT_THUMB_VERSION "1.0.1"
ImBuf *IMB_thumb_load_font(const char *filename, uint x, uint y)
ImBuf *IMB_thumb_load_font(const char *filepath, uint x, uint y)
{
ImBuf *ibuf = IMB_allocImBuf(x, y, 32, IB_rect | IB_metadata);
@@ -28,7 +28,7 @@ ImBuf *IMB_thumb_load_font(const char *filename, uint x, uint y)
const float col[4] = {1.0f, 1.0f, 1.0f, 0.0f};
IMB_rectfill(ibuf, col);
if (!BLF_thumb_preview(filename, ibuf->byte_buffer.data, ibuf->x, ibuf->y, ibuf->channels)) {
if (!BLF_thumb_preview(filepath, ibuf->byte_buffer.data, ibuf->x, ibuf->y, ibuf->channels)) {
IMB_freeImBuf(ibuf);
ibuf = nullptr;
}
@@ -46,9 +46,9 @@ bool IMB_thumb_load_font_get_hash(char *r_hash)
return true;
}
ImBuf *IMB_font_preview(const char *filename, uint width, const float color[4])
ImBuf *IMB_font_preview(const char *filepath, uint width, const float color[4])
{
int font_id = (filename[0] != '<') ? BLF_load(filename) : 0;
int font_id = (filepath[0] != '<') ? BLF_load(filepath) : 0;
const char sample[] = "ABCDEFGH\nabcdefg123";
BLF_buffer_col(font_id, color);