Partager via


IXRResourceManager::ResolveFontResource (Windows Embedded CE 6.0)

1/6/2010

This function is called by Silverlight to request support with loading font Uniform Resource Identifiers (URIs) declared in XAML markup.

You can override this function to provide custom code that supports Silverlight when it loads a font URI resource from XAML into a format compatible with the Silverlight system.

Syntax

virtual BOOL STDMETHODCALLTYPE ResolveFontResource(
    const WCHAR* pUri,
    HANDLE* pFile
) = 0;

Parameters

  • pUri
    [in] Pointer to a string that contains the font URI (from the XAML file) that specifies the desired font resource to resolve.
  • pFile
    [out] On return, handle to a .ttc file or .ttf file that defines the font family.

Return Value

Returns TRUE if the operation was successful; otherwise, returns FALSE.

Remarks

When Silverlight loads the XAML markup and parses the elements declared in XAML, it also loads the font resources that are declared in XAML through URIs.

ResolveResource can also be used to resolve a font URI and font-family name, such as "collection.ttc#arial".

For example, font URIs with font-family names that are defined in XAML can be declared by using the FontFamily attribute of the <TextBlock> element, as follows:

<TextBlock x:Name="GridTextBlock10" Grid.Row="1" Grid.Column="0" FontSize="14" FontFamily="castelar.ttf#Castellar" FontStyle="Italic"  Text="Hello"/>

When Silverlight parses the XAML markup and encounters these font URI declarations, it calls the resource manager to request information to help with quickly resolving the image resources declared in the XAML markup. If you want to provide support with this step, you must create and register an IXRResourceManager object by calling IXRApplication::RegisterResourceManager.

Silverlight will call CloseHandle on the object in pFile when the file is no longer required.

.NET Framework Equivalent

None.

Requirements

Header XamlRuntime.h
sysgen SYSGEN_XAML_RUNTIME
Windows Embedded CE Windows Embedded CE 6.0 R3

See Also

Reference

IXRResourceManager
IXRResourceManager::ResolveImageResource