rxvt_fontprop prop2 = prop;
if (res)
- prop2.weight = prop2.slant = rxvt_fontprop::unset;
+ {
+ fs->populate (res);
+ fs->set_prop (prop2, false);
+ }
else
{
- res = fontset[0]->fontdesc;
+ fs->populate (fontset[0]->fontdesc);
if (SET_STYLE (0, style) & RS_Bold) prop2.weight = rxvt_fontprop::bold;
if (SET_STYLE (0, style) & RS_Italic) prop2.slant = rxvt_fontprop::italic;
+
+ fs->set_prop (prop2, true);
}
- fs->populate (res);
- fs->set_prop (prop2, true);
}
#else
fontset[style] = fontset[0];
return p;
}
- bool load (const rxvt_fontprop &prop)
+ bool load (const rxvt_fontprop &prop, bool force_prop)
{
width = 1; height = 1;
ascent = 1; descent = 0;
rxvt_fontprop properties ();
- bool load (const rxvt_fontprop &prop);
+ bool load (const rxvt_fontprop &prop, bool force_prop);
bool has_char (unicode_t unicode, const rxvt_fontprop *prop, bool &careful) const;
}
bool
-rxvt_font_x11::load (const rxvt_fontprop &prop)
+rxvt_font_x11::load (const rxvt_fontprop &prop, bool force_prop)
{
dTermDisplay;
char field_str[64]; // enough for 128 bits
// first morph the font if required
- if (prop.weight != rxvt_fontprop::unset
- || prop.slant != rxvt_fontprop::unset)
+ if (force_prop)
{
char fname[1024];
rxvt_fontprop properties ();
- bool load (const rxvt_fontprop &prop);
+ bool load (const rxvt_fontprop &prop, bool force_prop);
void draw (rxvt_drawable &d, int x, int y,
const text_t *text, int len,
}
bool
-rxvt_font_xft::load (const rxvt_fontprop &prop)
+rxvt_font_xft::load (const rxvt_fontprop &prop, bool force_prop)
{
dTermDisplay;
FcPatternAddInteger (p, FC_PIXEL_SIZE, prop.height);
if (prop.weight != rxvt_fontprop::unset
- && FcPatternGet (p, FC_WEIGHT, 0, &v) != FcResultMatch)
+ && (force_prop || FcPatternGet (p, FC_WEIGHT, 0, &v) != FcResultMatch))
FcPatternAddInteger (p, FC_WEIGHT, prop.weight);
if (prop.slant != rxvt_fontprop::unset
- && FcPatternGet (p, FC_SLANT, 0, &v) != FcResultMatch)
+ && (force_prop || FcPatternGet (p, FC_SLANT, 0, &v) != FcResultMatch))
FcPatternAddInteger (p, FC_SLANT, prop.slant);
#if 0 // clipping unfortunately destroys our precious double-width-characters
{
prop.width = prop.height = prop.ascent = prop.weight = prop.slant
= rxvt_fontprop::unset;
+ force_prop = false;
for (rxvt_font **i = fonts.begin (); i != fonts.end (); i++)
FONT_UNREF (*i);
fonts[i]->loaded = true;
- if (!fonts[i]->load (prop))
+ if (!fonts[i]->load (prop, force_prop))
{
fonts[i]->cs = CS_UNKNOWN;
return false;
virtual rxvt_fontprop properties () = 0;
- virtual bool load (const rxvt_fontprop &morph) = 0;
+ virtual bool load (const rxvt_fontprop &morph, bool force_prop) = 0;
virtual bool has_char (uint32_t unicode, const rxvt_fontprop *prop, bool &careful) const = 0;
virtual void draw (rxvt_drawable &d,
~rxvt_fontset ();
bool populate (const char *desc);
- void set_prop (const rxvt_fontprop &prop) { this->prop = prop; }
+ void set_prop (const rxvt_fontprop &prop, bool force_prop) { this->prop = prop; this->force_prop = force_prop; }
int find_font (uint32_t unicode);
int find_font (const char *name) const;
bool realize_font (int i);
private:
rxvt_term *term;
rxvt_fontprop prop;
+ bool force_prop;
simplevec<rxvt_font *> fonts;
const rxvt_fallback_font *fallback;