IDWriteTextLayout::GetOverhangMetrics method (dwrite.h)
Returns the overhangs (in DIPs) of the layout and all objects contained in it, including text glyphs and inline objects.
HRESULT GetOverhangMetrics( [out] DWRITE_OVERHANG_METRICS *overhangs );
Overshoots of visible extents (in DIPs) outside the layout.
If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
Underlines and strikethroughs do not contribute to the black box determination, since these are actually drawn by the renderer, which is allowed to draw them in any variety of styles.