Altsoft FTMasterConnector Class Library

FTMasterConnector.Convert Method (Stream, Stream, FontFormat, FontFormat)

Converts font from one format into other.

public static bool Convert(
   Stream inputStream,
   Stream outputStream,
   FontFormat inputFormat,
   FontFormat targetFormat
);

Parameters

inputStream
Source stream containing input font.
outputStream
Resulting stream containing converted font( file access: read and write ).
inputFormat
Format of the input font.
targetFormat
Target format.

Return Value

true if the conversion was successful

Example

public static bool ConvertTrueTypeIntoType42()
{
    System.IO.Stream sTrueType = new System.IO.FileStream( "TrueType.ttf", System.IO.FileMode.Open, System.IO.FileAccess.Read );
    System.IO.Stream sType42 = new System.IO.FileStream( "Type42", System.IO.FileMode.OpenOrCreate, System.IO.FileAccess.ReadWrite  );
    bool bIsOK = FTMasterConnector.Convert( sTrueType, sType42, Altsoft.FTMaster.FTMasterConnector.FontFormat.TrueType, Altsoft.FTMaster.FTMasterConnector.FontFormat.Type42 );
    sType42.Close();
    return bIsOK;
}    
code>

See Also

FTMasterConnector Class | Altsoft.FTMaster Namespace | FTMasterConnector.Convert Overload List