Changeset 522


Ignore:
Timestamp:
Jul 31, 2016, 9:14:35 PM (5 years ago)
Author:
Gregg Young
Message:

Add substitute font name to Font dialog Ticket [280]

Location:
trunk/Lucide
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Lucide/gui/fontsInfoDlg.cpp

    r407 r522  
    4646#include "cpconv.h"
    4747
     48#define INCL_EXCEPTQ_CLASS
     49#define INCL_LOADEXCEPTQ
     50#include "exceptq.h"
     51
    4852
    4953FontsInfoDlg::FontsInfoDlg( HWND hWndFrame, LuDocument *_doc )
     
    5660    type       = newstrdupL( FONTINFO_TYPE );
    5761    embed      = newstrdupL( FONTINFO_EMBEDDED );
     62    subname    = newstrdupL( FONTINFO_SUBNAME );
    5863    emb_notembedded    = newstrdupL( FONTINFO_EMBED_NOT_EMBEDDED );
    5964    emb_embedded       = newstrdupL( FONTINFO_EMBED_EMBEDDED );
     
    6671    delete type;
    6772    delete embed;
     73    delete subname;
    6874    delete emb_notembedded;
    6975    delete emb_embedded;
     
    8490    PSZ type;
    8591    PSZ embed;
     92    PSZ subname;
    8693};
    8794
     
    119126                    break;
    120127            }
    121 
     128            r->subname = newstrdup( fonts->_buffer[i].subname );
     129           
    122130            RECORDINSERT ri;
    123131            ri.cb = sizeof( RECORDINSERT );
     
    136144void FontsInfoDlg::loadthread( void *p )
    137145{
     146    ScopedExceptqLoader sel;
    138147    FontsInfoDlg *_this = (FontsInfoDlg *)p;
     148
    139149    HAB thab = WinInitialize( 0 );
    140150    HMQ thmq = WinCreateMsgQueue( thab, 0 );
     
    162172    *str += " | ";
    163173    *str += rec->embed;
     174    *str += " | ";
     175    *str += rec->subname;
    164176    return true;
    165177}
     
    208220
    209221            PFIELDINFO pFieldInfo = (PFIELDINFO)WinSendMsg( _this->hContainer, CM_ALLOCDETAILFIELDINFO,
    210                                              MPFROMSHORT( 3 ), MPVOID );
     222                                             MPFROMSHORT( 4 ), MPVOID );
    211223            PFIELDINFO pFldInfo = pFieldInfo;
    212224            pFldInfo->cb = sizeof( FIELDINFO );
     
    227239            pFldInfo->pTitleData = (PVOID)_this->embed;
    228240            pFldInfo->offStruct = FIELDOFFSET( ListRec, embed );
     241            pFldInfo = pFldInfo->pNextFieldInfo;
     242            pFldInfo->cb = sizeof( FIELDINFO );
     243            pFldInfo->flData = CFA_STRING | CFA_HORZSEPARATOR | CFA_SEPARATOR;
     244            pFldInfo->flTitle = CFA_CENTER;
     245            pFldInfo->pTitleData = (PVOID)_this->subname;
     246            pFldInfo->offStruct = FIELDOFFSET( ListRec, subname );
    229247
    230248            FIELDINFOINSERT fieldInfoInsert;
    231249            fieldInfoInsert.cb = sizeof( FIELDINFOINSERT );
    232250            fieldInfoInsert.pFieldInfoOrder = (PFIELDINFO)CMA_FIRST;
    233             fieldInfoInsert.cFieldInfoInsert = 3;
     251            fieldInfoInsert.cFieldInfoInsert = 4;
    234252            fieldInfoInsert.fInvalidateFieldInfo = TRUE;
    235253            WinSendMsg( _this->hContainer, CM_INSERTDETAILFIELDINFO,
     
    252270                delete pr->type;
    253271                delete pr->embed;
     272                delete pr->subname;
    254273                pr = (ListRec *)WinSendMsg( _this->hContainer, CM_QUERYRECORD,
    255274                                    MPFROMP( pr ), MPFROM2SHORT( CMA_NEXT, CMA_ITEMORDER ) );
  • trunk/Lucide/gui/fontsInfoDlg.h

    r367 r522  
    6363       
    6464        // columns titles
    65         PSZ name, type, embed;
     65        PSZ name, type, embed, subname;
    6666        // embed values
    6767        PSZ emb_notembedded, emb_embedded, emb_embeddedsubset;
  • trunk/Lucide/gui/messages.cpp

    r459 r522  
    9696const char *FONTINFO_TYPE     = "FONTINFO_TYPE";
    9797const char *FONTINFO_EMBEDDED = "FONTINFO_EMBEDDED";
     98const char *FONTINFO_SUBNAME  = "FONTINFO_SUBNAME";
    9899// 'Fonts Info' Embedded types
    99100const char *FONTINFO_EMBED_NOT_EMBEDDED    = "FONTINFO_EMBED_NOT_EMBEDDED";
  • trunk/Lucide/gui/messages.h

    r459 r522  
    9797extern const char *FONTINFO_TYPE;
    9898extern const char *FONTINFO_EMBEDDED;
     99extern const char *FONTINFO_SUBNAME;
    99100// 'Fonts Info' Embedded types
    100101extern const char *FONTINFO_EMBED_NOT_EMBEDDED;
  • trunk/Lucide/plugins/ludoc/lutypes.h

    r367 r522  
    8282    char  *type;
    8383    short embedded;
     84    char  *subname;
    8485};
    8586
  • trunk/Lucide/plugins/lupoppler/lupoppler.cpp

    r520 r522  
    871871        fonts->_buffer[i].type = NULL;
    872872        fonts->_buffer[i].embedded = NULL;
     873        fonts->_buffer[i].subname = NULL;
    873874
    874875        FontInfo *info = (FontInfo *)items->get( i );
     
    919920            fonts->_buffer[i].embedded = LU_FONTEMBED_NOT_EMBEDDED;
    920921        }
     922        // SubstituteName
     923        GooString *ggnm = info->getSubstituteName();
     924        if ( ggnm != NULL )
     925        {
     926            fonts->_buffer[i].subname = somstrdup( ggnm->getCString() );
     927                   }
    921928    }
    922929
Note: See TracChangeset for help on using the changeset viewer.