WIP: Brush assets project #106303

Draft
Julian Eisel wants to merge 381 commits from brush-assets-project into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
3 changed files with 10 additions and 4 deletions
Showing only changes of commit 3ce407e757 - Show all commits

View File

@ -375,7 +375,11 @@ enum {
BLF_BAD_FONT = 1 << 16, BLF_BAD_FONT = 1 << 16,
/** This font is managed by the FreeType cache subsystem. */ /** This font is managed by the FreeType cache subsystem. */
BLF_CACHED = 1 << 17, BLF_CACHED = 1 << 17,
/** At small sizes glyphs are rendered at multiple sub-pixel positions. */ /**
* At small sizes glyphs are rendered at multiple sub-pixel positions.
*
* \note Can be checked without checking #BLF_MONOSPACED which can be assumed to be disabled.
*/
BLF_RENDER_SUBPIXELAA = 1 << 18, BLF_RENDER_SUBPIXELAA = 1 << 18,
}; };

View File

@ -1322,7 +1322,7 @@ GlyphBLF *blf_glyph_ensure(FontBLF *font, GlyphCacheBLF *gc, const uint charcode
#ifdef BLF_SUBPIXEL_AA #ifdef BLF_SUBPIXEL_AA
GlyphBLF *blf_glyph_ensure_subpixel(FontBLF *font, GlyphCacheBLF *gc, GlyphBLF *g, int32_t pen_x) GlyphBLF *blf_glyph_ensure_subpixel(FontBLF *font, GlyphCacheBLF *gc, GlyphBLF *g, int32_t pen_x)
{ {
if (!(font->flags & BLF_RENDER_SUBPIXELAA) || (font->flags & BLF_MONOCHROME)) { if (!(font->flags & BLF_RENDER_SUBPIXELAA)) {
/* Not if we are in mono mode (aliased) or the feature is turned off. */ /* Not if we are in mono mode (aliased) or the feature is turned off. */
return g; return g;
} }

View File

@ -460,8 +460,10 @@ void uiStyleInit()
if (U.text_render & USER_TEXT_DISABLE_AA) { if (U.text_render & USER_TEXT_DISABLE_AA) {
flag_enable |= BLF_MONOCHROME; flag_enable |= BLF_MONOCHROME;
} }
if (U.text_render & USER_TEXT_RENDER_SUBPIXELAA) { else {
flag_enable |= BLF_RENDER_SUBPIXELAA; if (U.text_render & USER_TEXT_RENDER_SUBPIXELAA) {
flag_enable |= BLF_RENDER_SUBPIXELAA;
}
} }
LISTBASE_FOREACH (uiFont *, font, &U.uifonts) { LISTBASE_FOREACH (uiFont *, font, &U.uifonts) {