interface IDWriteFactory2 {
CONST_VTBL IDWriteFactory2Vtbl* lpVtbl;
};
-#else /* ifndef MINGW_W64 */
+#else /* MINGW_W64 */
# include <dwrite_3.h>
#endif
-/* User configurable variables. If they are lower than 0 use
+/* User configurable variables. If they are smaller than 0, use
DirectWrite's defaults, or our defaults. To set them, the user calls
'w32-dwrite-reinit' */
static float config_enhanced_contrast = -1.0f;
}
}
-#define RELEASE_COM(i) release_com ( (IUnknown **) &i )
+#define RELEASE_COM(i) release_com ((IUnknown **) &i)
/* Global variables for DirectWrite. */
static bool direct_write_available = false;
return true;
}
-/* Gets a IDWriteFontFace from a struct font (its HFONT). Returns the
+/* Gets a IDWriteFontFace from a struct font (its HFONT). Returns the
font size in points. It may fail to get a DirectWrite font, and face
will be NULL on return. This happens for some fonts like Courier.
}
/* Cache this FontFace. */
- uniscribe_font->dwrite_font_size = abs (logfont.lfHeight);
+ uniscribe_font->dwrite_font_size = eabs (logfont.lfHeight);
uniscribe_font->dwrite_cache = *face;
- return abs (logfont.lfHeight);
+ return eabs (logfont.lfHeight);
}
void
if (metrics->rbearing < rbearing)
metrics->rbearing = rbearing;
}
- metrics->width = round(width);
+ metrics->width = round (width);
SAFE_FREE ();
return true;
}
DebPrint (("DirectWrite HRESULT failed: (%d) QueryInterface IDWriteFactory2\n", hr));
RELEASE_COM (dwrite_factory);
FreeLibrary (direct_write);
- eassert (SUCCEEDED (hr));
return;
}
glyph_run.glyphIndices = indices;
glyph_run.glyphCount = len;
glyph_run.isSideways = false;
- glyph_run.bidiLevel = 0;
+ glyph_run.bidiLevel = 0; /* we reorder bidi text ourselves */
glyph_run.glyphOffsets = NULL;
glyph_run.glyphAdvances = advances;
IDWriteColorGlyphRunEnumerator *layers;
- /* This call will tell us if we hace to handle any color glyph. */
+ /* This call will tell us if we have to handle any color glyphs. */
hr = dwrite_factory2->lpVtbl->TranslateColorGlyphRun (dwrite_factory2,
0, font->ascent,
&glyph_run,
NULL);
else
{
- /* If there were color glyphs, layers contains a list of GlyphRun
- with a color and a position for each. We draw them
+ /* If there were color glyphs, 'layers' contains a list of
+ GlyphRun with a color and a position for each. We draw them
individually. */
if (!verify_hr (hr, "Failed at TranslateColorGlyphRun"))
{
DEFUN ("w32-dwrite-reinit", Fw32_dwrite_reinit, Sw32_dwrite_reinit, 0, 3, 0,
doc: /* Reinitialize DirectWrite with the given parameters.
If a parameter is not specified, or is out of range, it will take a default
-value. Returns nil.
+value.
+
+Return value is nil.
-ENHANCED_CONTRAST is in the range [0.0, 1.0]
-CLEAR_TYPE_LEVEL is in the range [0.0, 1.0]
-GAMMA is in the range (0.0, 256.0] */)
+ENHANCED_CONTRAST is in the range [0.0, 1.0], and defaults to 0.0.
+CLEAR_TYPE_LEVEL is in the range [0.0, 1.0], and defaults to 0.0.
+GAMMA is in the range (0.0, 256.0], and defaults to 2.2. */)
(Lisp_Object enhanced_contrast, Lisp_Object clear_type_level,
Lisp_Object gamma)
{
for (i = 0; i < len; i++)
if (!w32_use_direct_write (w32font) ||
!w32_dwrite_draw (s->hdc, x, y, s->char2b + from, 1,
- GetTextColor(s->hdc), s->font))
+ GetTextColor (s->hdc), s->font))
{
WCHAR c = s->char2b[from + i] & 0xFFFF;
ExtTextOutW (s->hdc, x + i, y, options, NULL, &c, 1, NULL);
{
if (!w32_use_direct_write (w32font) ||
!w32_dwrite_draw (s->hdc, x, y,
- s->char2b + from, len, GetTextColor(s->hdc),
+ s->char2b + from, len, GetTextColor (s->hdc),
s->font))
{
/* The number of glyphs in a glyph_string cannot be larger than