View | Details | Raw Unified | Return to issue 79878
Collapse All | Expand All

(-)psprint/source/fontmanager/fontconfig.cxx (-2 / +51 lines)
Lines 467-473 bool PrintFontManager::initFontconfig() Link Here
467
            if( pUpdate )
467
            if( pUpdate )
468
            {
468
            {
469
                // set family name
469
                // set family name
470
                if( pUpdate->m_nFamilyName != nFamilyName )
470
//---> i79878
471
// if the font is a true type, fontconfig returns the Preferred family and the Preferred subfamily (e.g. the preferred style)
472
// something that OOo UI can't manage.
473
//
474
// but when we arrive here in the case of a true type font file, the correct family and subfamily have already
475
// been filled by the TrueType management system in place (starts from analyzeFontFile above)
476
// 
477
// it's the font family name (in the case of truetype it's the preferred family name, it this NameRecord is filled)
478
// in case of true type, the correct file name has already been set when filling the font cache
479
// from the TT file
480
//
481
// important:
482
// the file:
483
// user/psprint/pspfontcache
484
// should be removed manually before this patch is effective
485
// or:
486
// 1. remove the font OOo doesn't 'see',
487
// 2. start OOo,
488
// 3. close OOo,
489
// 4. put the font removed at 1 back in place
490
// 5. restart OOo, the font should be seen again.
491
//
492
                if(
493
// remove the following single line when new UI for font selection is in place
494
// that is, when the Preferred family (OpenType name table ID 16) and Preferred subfamily (OpenType name table ID 17)
495
// can be used to group the fonts (see OpenType 1.4 spec for details)
496
                    pUpdate->m_eType != fonttype::TrueType &&
497
//<---i79878
498
                    pUpdate->m_nFamilyName != nFamilyName)
471
                {
499
                {
472
                    pUpdate->m_aAliases.remove( pUpdate->m_nFamilyName );
500
                    pUpdate->m_aAliases.remove( pUpdate->m_nFamilyName );
473
                    pUpdate->m_aAliases.push_back( pUpdate->m_nFamilyName );
501
                    pUpdate->m_aAliases.push_back( pUpdate->m_nFamilyName );
Lines 516-522 bool PrintFontManager::initFontconfig() Link Here
516
                    else if( slant == FC_SLANT_OBLIQUE )
544
                    else if( slant == FC_SLANT_OBLIQUE )
517
                        pUpdate->m_eItalic = italic::Oblique;
545
                        pUpdate->m_eItalic = italic::Oblique;
518
                }
546
                }
519
                if( eStyleRes == FcResultMatch )
547
                if(
548
//---> i79878
549
// remove the following single line when new UI for font selection is in place
550
// that is, when the Preferred family (OpenType name table ID 16) and Preferred subfamily (OpenType name table ID 17)
551
// can be used to group the fonts (see OpenType 1.4 spec for details)
552
//
553
// It seems that this part is still to be investigated, the TrueType OOo subsystems doesn't
554
// return the correct Subfamily
555
//
556
// important:
557
// the file:
558
// user/psprint/pspfontcache
559
// should be removed manually before this patch is effective
560
// or:
561
// 1. remove the font OOo doesn't 'see',
562
// 2. start OOo,
563
// 3. close OOo,
564
// 4. put the font removed at 1 back in place
565
// 5. restart OOo, the font should be seen again.
566
                    pUpdate->m_eType != fonttype::TrueType &&
567
// <---i79878
568
                    eStyleRes == FcResultMatch )
520
                {
569
                {
521
                    pUpdate->m_aStyleName = OStringToOUString( OString( (sal_Char*)style ), RTL_TEXTENCODING_UTF8 );
570
                    pUpdate->m_aStyleName = OStringToOUString( OString( (sal_Char*)style ), RTL_TEXTENCODING_UTF8 );
522
                }
571
                }
(-)psprint/source/fontmanager/fontmanager.cxx (+9 lines)
Lines 1940-1945 bool PrintFontManager::analyzeTrueTypeFi Link Here
1940
1940
1941
        if( aInfo.usubfamily )
1941
        if( aInfo.usubfamily )
1942
            pFont->m_aStyleName = OUString( aInfo.usubfamily );
1942
            pFont->m_aStyleName = OUString( aInfo.usubfamily );
1943
//---> i79878
1944
// with this  added the string appearing into the
1945
// the dialog for style is in English only
1946
// with this disable the text, if available, is one of the standard
1947
// available in the current user L10N of OOo
1948
        else if( aInfo.subfamily ) // if there is no unicode, then check roman (ascii 8 bit) string
1949
            pFont->m_aStyleName = OUString( OUString::createFromAscii( aInfo.subfamily ) );
1950
//<---
1951
1943
1952
1944
        pFont->m_nPSName = m_pAtoms->getAtom( ATOM_PSNAME, String( ByteString( aInfo.psname ), aEncoding ), sal_True );
1953
        pFont->m_nPSName = m_pAtoms->getAtom( ATOM_PSNAME, String( ByteString( aInfo.psname ), aEncoding ), sal_True );
1945
        switch( aInfo.weight )
1954
        switch( aInfo.weight )
(-)psprint/source/fontsubset/sft.c (-7 / +7 lines)
Lines 1150-1164 static void GetNames(TrueTypeFont *t) Link Here
1150
1150
1151
    /* Font family and subfamily names: preferred Apple */
1151
    /* Font family and subfamily names: preferred Apple */
1152
    t->family = NULL;
1152
    t->family = NULL;
1153
    if ((r = findname(table, n, 0, 0, 0, 1)) != -1)
1153
    if ((r = findname(table, n, 0, 0, 0, 1)) != -1) //platform Unicode, encoding Unicode 1.0 semantics, no lang
1154
        t->family = nameExtract(table, nTableSize, r, 1, &t->ufamily);
1154
        t->family = nameExtract(table, nTableSize, r, 1, &t->ufamily);
1155
    if ( ! t->family && (r = findname(table, n, 3, 1, 0x0409, 1)) != -1)
1155
    if ( ! t->family && (r = findname(table, n, 3, 1, 0x0409, 1)) != -1) //platform Microsoft, encoding Unicode BMP only, lang US English
1156
        t->family = nameExtract(table, nTableSize, r, 1, &t->ufamily);
1156
        t->family = nameExtract(table, nTableSize, r, 1, &t->ufamily);
1157
    if ( ! t->family && (r = findname(table, n, 1, 0, 0, 1)) != -1)
1157
    if ( ! t->family && (r = findname(table, n, 1, 0, 0, 1)) != -1)  // platform Apple, encoding roman, lang English
1158
        t->family = nameExtract(table, nTableSize, r, 0, NULL);
1158
        t->family = nameExtract(table, nTableSize, r, 0, NULL);
1159
    if ( ! t->family && (r = findname(table, n, 3, 1, 0x0411, 1)) != -1)
1159
    if ( ! t->family && (r = findname(table, n, 3, 1, 0x0411, 1)) != -1)  //platform Microsoft, encoding Unicode BMP only, lang Japanese
1160
        t->family = nameExtract(table, nTableSize, r, 1, &t->ufamily);
1160
        t->family = nameExtract(table, nTableSize, r, 1, &t->ufamily);
1161
    if ( ! t->family && (r = findname(table, n, 3, 0, 0x0409, 1)) != -1)
1161
    if ( ! t->family && (r = findname(table, n, 3, 0, 0x0409, 1)) != -1)  //platform Microsoft, encoding symbol, lang US English
1162
        t->family = nameExtract(table, nTableSize, r, 1, &t->ufamily);
1162
        t->family = nameExtract(table, nTableSize, r, 1, &t->ufamily);
1163
    if ( ! t->family )
1163
    if ( ! t->family )
1164
    {
1164
    {
Lines 1168-1176 static void GetNames(TrueTypeFont *t) Link Here
1168
1168
1169
    t->subfamily = NULL;
1169
    t->subfamily = NULL;
1170
    t->usubfamily = NULL;
1170
    t->usubfamily = NULL;
1171
    if ((r = findname(table, n, 1, 0, 0, 2)) != -1)
1171
    if ((r = findname(table, n, 1, 0, 0, 2)) != -1) // platform Apple, encoding roman, lang English
1172
        t->subfamily = nameExtract(table, nTableSize, r, 0, &t->usubfamily);
1172
        t->subfamily = nameExtract(table, nTableSize, r, 0, &t->usubfamily);
1173
    if ( ! t->subfamily && (r = findname(table, n, 3, 1, 0x0409, 2)) != -1)
1173
    if ( ! t->subfamily && (r = findname(table, n, 3, 1, 0x0409, 2)) != -1)  // platform Microsoft, encoding Unicode BPM only, lang English
1174
        t->subfamily = nameExtract(table, nTableSize, r, 1, &t->usubfamily);
1174
        t->subfamily = nameExtract(table, nTableSize, r, 1, &t->usubfamily);
1175
    if ( ! t->subfamily )
1175
    if ( ! t->subfamily )
1176
    {
1176
    {

Return to issue 79878