次の方法で共有


IXRResourceManager::ResolveFontResource (Compact 2013)

3/28/2014

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

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 XAML for Windows Embedded 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 XAML for Windows Embedded 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.

XAML for Windows Embedded will call CloseHandle on the object in pFile when the file is no longer required.

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

.NET Framework Equivalent

None.

Requirements

Header

XamlRuntime.h

sysgen

SYSGEN_XAML_RUNTIME

See Also

Reference

IXRResourceManager
IXRResourceManager::ResolveImageResource