vlc_linux/vlc-3.0.16/modules/text_renderer/freetype/fonts/dwrite.cpp
/*
 * Check for a partial match e.g. between Roboto and Roboto Thin.
 * In this case p_unmatched will be set to Thin.
 * Also used for face names, in which case Thin will match Thin,
 * Thin Italic, Thin Oblique...
 */
Check for a partial match e.g. between Roboto and Roboto Thin.
In this case p_unmatched will be set to Thin.
Also used for face names, in which case Thin will match Thin,
Thin Italic, Thin Oblique
Check for a partial match e . g . between Roboto and Roboto Thin . In this case p_unmatched will be set to Thin . Also used for face names in which case Thin will match Thin Thin Italic Thin Oblique
static bool DWrite_PartialMatch( filter_t *p_filter, const wstring &full_name,
                                 const wstring &partial_name, wstring *p_unmatched = nullptr )
{
    auto pattern = wstring{ L"^" } + SanitizeName( partial_name ) + wstring{ L"\\s*(.*)$" };
    auto rx = wregex{ pattern, wregex::icase };
    auto match = wsmatch{};
    if( !regex_match( full_name, match, rx ) )
        return false;
    msg_Dbg( p_filter, "DWrite_PartialMatch(): %S matches %S", full_name.c_str(), partial_name.c_str() );
    if( p_unmatched )
        *p_unmatched = match[ 1 ].str();
    return true;
}
static bool DWrite_PartialMatch ( filter_t * p_filter , const wstring & full_name , const wstring & partial_name , wstring * p_unmatched = nullptr ) { auto pattern = wstring { L" " } + SanitizeName ( partial_name ) + wstring { L" \\ " } ; auto rx = wregex { pattern , wregex :: icase } ; auto match = wsmatch { } ; if ( ! regex_match ( full_name , match , rx ) ) return false ; msg_Dbg ( p_filter , " " , full_name . c_str ( ) , partial_name . c_str ( ) ) ; if ( p_unmatched ) * p_unmatched = match [ 1 ] . str ( ) ; return true ; }
Check for a partial match e.g.
Check for a partial match e . g .