本文整理汇总了C++中CWord::AddLetter2Word方法的典型用法代码示例。如果您正苦于以下问题:C++ CWord::AddLetter2Word方法的具体用法?C++ CWord::AddLetter2Word怎么用?C++ CWord::AddLetter2Word使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CWord
的用法示例。
在下文中一共展示了CWord::AddLetter2Word方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ExtractWordsFromString
/////////////////////////////////////////////////////////////////////////////
// CFString::ExtractWordsFromString
void CFString::ExtractWordsFromString( CSTR_line* Comingline , PageElementCount* Count)
{
CSTR_rast_attr rast_attr;
CSTR_rast rast;
RecVersions vers;
CSTR_line line;
CSTR_attr line_attr;
CWord* CurrentWord;
const char* SeparatorsWord=" ";
const char* result=NULL;
int16_t FlagWord;
Bool FlagString,FlagCapDrop;
line = *Comingline;
FlagWord = 0;
FlagString = FALSE;
FlagCapDrop = FALSE;
CSTR_GetLineAttr( line , &line_attr );
if(line_attr.Flags & CSTR_STR_CapDrop) //буквица - см. первая буква в сказках
FlagCapDrop = TRUE;
SetRect(&m_rectBaseLine, line_attr.bs1, line_attr.bs2,
line_attr.bs3, line_attr.bs4); //don't used now
SetRect(&m_rectString, line_attr.col - TemplateOffset.x,
line_attr.row - TemplateOffset.y,
line_attr.col - TemplateOffset.x + line_attr.wid,
line_attr.row - TemplateOffset.y + line_attr.hei);
#ifdef alDebug //obsolete option
{
RECT rect;
SetRect(&rect,line_attr.col, line_attr.row,
line_attr.col + line_attr.wid,
line_attr.row + line_attr.hei);
pInputArray->push_back(rect);
}
#endif
rast = CSTR_GetFirstRaster( line ); // I фикт. растр
rast = CSTR_GetNextRaster( rast , CSTR_f_all );
while( rast )
{
CSTR_GetCollection( rast,&vers );
CSTR_GetAttr( rast,&rast_attr );
//#define NEG_HALF_SPACE 0x1e
//#define POS_HALF_SPACE 0x1f
//#define REGULAR_SPACE 0x20
if((rast_attr.flg&CSTR_f_dust) || (rast_attr.flg&CSTR_f_fict ) ||//Дусты и
((rast_attr.flg&CSTR_f_space) &&
(!vers.Alt[0].Code || vers.Alt[0].Code == 0x1e ||
vers.Alt[0].Code == 0x1f)))//полупробелы выкидываем.
goto next_raster;
FlagString = TRUE;
result = strchr( SeparatorsWord, vers.Alt[0].Code );
if( FlagWord ){ // word openly
if(result) // word is broken
FlagWord =0;
else{ // word lasts
assert( CurrentWord );
CurrentWord->AddLetter2Word( &rast , Count ,&FlagCapDrop );
}
}
else{ // expect new word
if(!result){ // beginning word
++m_wWordsCount;
++Count->Words;
FlagWord = 1;
m_arWords.push_back( new CWord() );
CurrentWord = m_arWords[m_wWordsCount-1];
assert( CurrentWord );
if(rast_attr.font_spec == CSTR_fs_courier)
CurrentWord->m_wFontNumber = rast_attr.font & 0xFC;
else
CurrentWord->m_wFontNumber = rast_attr.font;
CurrentWord->m_wFontPointSize = rast_attr.keg;
CurrentWord->AddLetter2Word( &rast , Count ,&FlagCapDrop );
if(FlagCapDrop){
CurrentWord->m_wFontPointSize = 14;
FlagCapDrop = FALSE;
FlagWord = 0;
}
}
}
next_raster:
rast = CSTR_GetNextRaster( rast , CSTR_f_all );
}
if(FlagString == FALSE)
Count->Strings--;
}