Extract Geometry from Font

alt text

In Adobe Illustrator

Object Menu > Expand...

This will convert the text to paths made of anchors and Bezier curves.

Aside from using an application, I don't know how to do this programmatically.


I needed the output in MATLAB so took the correctly marked answer using the MATLAB.NET interface. Source code posted below

clear all
% Import .NET Framework System.Drawing
NET.addAssembly('System.Drawing');      

% Display all available System Fonts (optional)
    AvailableFonts = System.Drawing.Text.InstalledFontCollection();
    for i=1:AvailableFonts.Families.Length
        disp(AvailableFonts.Families(i).Name);
    end

% Get GraphicsPath of chosen Font and text string
% https://msdn.microsoft.com/en-us/library/ms142533(v=vs.110).aspx

FontData= System.Drawing.Drawing2D.GraphicsPath();

text='Hello World';
font=System.Drawing.FontFamily('Arial');
style=cast(System.Drawing.FontStyle.Regular,'Int32');
emSize=48;
origin=System.Drawing.Point(0,0);
format=System.Drawing.StringFormat();

FontData.AddString(text,font,style,emSize,origin,format);

%Extract X,Y data from FontData

for i=1:FontData.PathPoints.Length
    x(i)=FontData.PathPoints(i).X;
    y(i)=-FontData.PathPoints(i).Y; 
end

plot(x,y)

For Windows, you can use Gdiplus. Create a GraphicsPath and call AddString() on it.

Then examine the PathData or PathPoints.