Is there any simple and compatible GDI or .NET accessible subsystem of Windows that will give glyph position characters. The task here is the combining symbols such as those in Arabic which sometimes have chains of multiple combining symbols stacking on top of each others such as Arabic Fatha + Arabic Letter Superscript Alef + Arabic Maddah Above. The trouble is that though the X positions can be determined precisely with GDI GetCharacterPlacement, the Y position calculations which are derived from OpenType or TrueType font tables and anchors and a complex set of rules, is not available. Ultimately, to generate a PDF with Arabic properly formatted, the Y positions are needed and precisely. Studying Microsoft Word 2013's save as PDF feature, it is clear they have a way of properly gathering this data as studying the PDF details shows that each character is displayed at its precise position including the combining symbols.
WPF may contain some functions to do this in the GlyphRun class property GlyphOffsets. DirectWrite has the IDWriteTextAnalyzer interface which method GetGlyphPlacements can return DWRITE_GLYPH_OFFSETs and many other complex script information. Looking at the GDI Display and Printer Drive functions, STROBJ_bEnumPositionsOnly seems to return a set of GLYPHPOS structures with this information. GDI certainly renders this correctly under all circumstances if you send the full text to render but not if you want to do it glyph by glyph.
IXpsOMGlyphs in the XPS Object Model allows for a GetGlyphIndices call returning a set of XPS_GLYPH_INDEX gives horizontalOffset and verticalOffset though this library is hardly appropriate.
In the end the only appropriate library looks to be Uniscribe which is complex to use but supported since Internet Explorer 5 and Windows 2000 as opposed to all the other discussions beyond GDI which are generally Vista and later or requiring special dependencies. ScriptItemize returns an array of SCRIPT_STRING_ANALYSIS which can be passed to ScriptShape then ScriptPlace returning an array o GOFFSETs. In fact Uniscribe will given information about word breaks, diacritics, directional flow and many other aspects of what is happening in a complex script. I just wanted to know if there is a simpler method or if this is the minimum required and exact appropriate for such a task since Uniscribe appears to be extremely difficult to use directly from .NET and reasonably would need a C++ wrapper since there are a great deal of structures and pointers.
Update and answer: Uniscribe will not work for PDF purposes as it uses integers in GDI device units thus the accuracy is greatly compromised. Probably why Microsoft Word 2013 finally supports native PDF conversion support because ultimately DirectWrite seems to be relied upon. As mentioned below I posted both code solutions in .NET as tips on CodeProject. DirectWrite seems to be the only answer beyond designing a custom font shaping and calculation engine.
Sample Uniscribe code in .NET since it is not available on the web currently: