Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

CreateScalableFontResource function

[The CreateScalableFontResource function is available for use in the operating systems specified in the Requirements section. It may be altered or unavailable in subsequent versions.]

The CreateScalableFontResource function creates a font resource file for a scalable font.

Syntax


BOOL CreateScalableFontResource(
  _In_  DWORD fdwHidden,
  _In_  LPCTSTR lpszFontRes,
  _In_  LPCTSTR lpszFontFile,
  _In_  LPCTSTR lpszCurrentPath
);

Parameters

fdwHidden [in]

Specifies whether the font is a read-only font. This parameter can be one of the following values.

ValueMeaning
0

The font has read/write permission.

1

The font has read-only permission and should be hidden from other applications in the system. When this flag is set, the font is not enumerated by the EnumFonts or EnumFontFamilies function.

 

lpszFontRes [in]

A pointer to a null-terminated string specifying the name of the font resource file to create. If this parameter specifies an existing font resource file, the function fails.

lpszFontFile [in]

A pointer to a null-terminated string specifying the name of the scalable font file that this function uses to create the font resource file.

lpszCurrentPath [in]

A pointer to a null-terminated string specifying the path to the scalable font file.

Return value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero.

If lpszFontRes specifies an existing font file, GetLastError returns ERROR_FILE_EXISTS

Remarks

The CreateScalableFontResource function is used by applications that install TrueType fonts. An application uses the CreateScalableFontResource function to create a font resource file (typically with a .fot file name extension) and then uses the AddFontResource function to install the font. The TrueType font file (typically with a .ttf file name extension) must be in the System subdirectory of the Windows directory to be used by the AddFontResource function.

The CreateScalableFontResource function currently supports only TrueType-technology scalable fonts.

When the lpszFontFile parameter specifies only a file name and extension, the lpszCurrentPath parameter must specify a path. When the lpszFontFile parameter specifies a full path, the lpszCurrentPath parameter must be NULL or a pointer to NULL.

When only a file name and extension are specified in the lpszFontFile parameter and a path is specified in the lpszCurrentPath parameter, the string in lpszFontFile is copied into the .fot file as the .ttf file that belongs to this resource. When the AddFontResource function is called, the operating system assumes that the .ttf file has been copied into the System directory (or into the main Windows directory in the case of a network installation). The .ttf file need not be in this directory when the CreateScalableFontResource function is called, because the lpszCurrentPath parameter contains the directory information. A resource created in this manner does not contain absolute path information and can be used in any installation.

When a path is specified in the lpszFontFile parameter and NULL is specified in the lpszCurrentPath parameter, the string in lpszFontFile is copied into the .fot file. In this case, when the AddFontResource function is called, the .ttf file must be at the location specified in the lpszFontFile parameter when the CreateScalableFontResource function was called; the lpszCurrentPath parameter is not needed. A resource created in this manner contains absolute references to paths and drives and does not work if the .ttf file is moved to a different location.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

End of client support

Windows XP

End of server support

Windows Server 2003

Header

Wingdi.h (include Windows.h)

Library

Gdi32.lib

DLL

Gdi32.dll

Unicode and ANSI names

CreateScalableFontResourceW (Unicode) and CreateScalableFontResourceA (ANSI)

See also

Fonts and Text Overview
Font and Text Functions
AddFontResource
EnumFonts
EnumFontFamilies

 

 

Community Additions

Show:
© 2014 Microsoft