I'm still not convinced by this, so I took an old test program and modified it a little bit: [measuretext.c](/uploads/65d666c29788a2f9451b0cc7bc79dfbe/measuretext.c) [measuretext.exe](/uploads/6e98b643b1b984264fc00b201301c57c/measuretext.exe)
It seems that on Windows, LineLimit does what msdn says, but there's a little bit of a gap between the height that MeasureCharacterRanges reports and the height that MeasureString reports. If the size is inside that gap, MeasureString will report the height it's given, and LineLimit will not prevent the last line from being drawn.
It seems like fixing this will require gdip_format_string to have a little bit more awareness of the font metrics.