Esempio n. 1
0
CPVT_WordPlace CPDF_VariableText::InsertWord(const CPVT_WordPlace& place,
                                             uint16_t word,
                                             int32_t charset,
                                             const CPVT_WordProps* pWordProps) {
  int32_t nTotlaWords = GetTotalWords();
  if (m_nLimitChar > 0 && nTotlaWords >= m_nLimitChar)
    return place;
  if (m_nCharArray > 0 && nTotlaWords >= m_nCharArray)
    return place;

  CPVT_WordPlace newplace = place;
  newplace.nWordIndex++;
  int32_t nFontIndex =
      GetSubWord() > 0 ? GetDefaultFontIndex()
                       : GetWordFontIndex(word, charset, GetDefaultFontIndex());
  return AddWord(newplace, CPVT_WordInfo(word, charset, nFontIndex, nullptr));
}
Esempio n. 2
0
void CPDF_VariableText::Initialize() {
  if (!m_bInitial) {
    CPVT_SectionInfo secinfo;
    CPVT_WordPlace place;
    place.nSecIndex = 0;
    AddSection(place, secinfo);
    CPVT_LineInfo lineinfo;
    lineinfo.fLineAscent = GetFontAscent(GetDefaultFontIndex(), GetFontSize());
    lineinfo.fLineDescent =
        GetFontDescent(GetDefaultFontIndex(), GetFontSize());
    AddLine(place, lineinfo);
    if (CSection* pSection = m_SectionArray.GetAt(0))
      pSection->ResetLinePlace();

    m_bInitial = TRUE;
  }
}
void CPDF_VariableText::Initialize() {
  if (!m_bInitial) {
    CPVT_SectionInfo secinfo;
    if (m_bRichText) {
      secinfo.pSecProps = new CPVT_SecProps(0.0f, 0.0f, 0);
      secinfo.pWordProps = new CPVT_WordProps(
          GetDefaultFontIndex(), kDefaultFontSize, 0, ScriptType::Normal, 0);
    }
    CPVT_WordPlace place;
    place.nSecIndex = 0;
    AddSection(place, secinfo);
    CPVT_LineInfo lineinfo;
    lineinfo.fLineAscent = GetFontAscent(GetDefaultFontIndex(), GetFontSize());
    lineinfo.fLineDescent =
        GetFontDescent(GetDefaultFontIndex(), GetFontSize());
    AddLine(place, lineinfo);
    if (CSection* pSection = m_SectionArray.GetAt(0))
      pSection->ResetLinePlace();

    m_bInitial = TRUE;
  }
}
FX_FLOAT CPDF_VariableText::GetLineDescent(const CPVT_SectionInfo& SecInfo) {
  return m_bRichText && SecInfo.pWordProps
             ? GetFontDescent(SecInfo.pWordProps->nFontIndex,
                              SecInfo.pWordProps->fFontSize)
             : GetFontDescent(GetDefaultFontIndex(), GetFontSize());
}
Esempio n. 5
0
FX_FLOAT CPDF_VariableText::GetLineDescent(const CPVT_SectionInfo& SecInfo) {
  return GetFontDescent(GetDefaultFontIndex(), GetFontSize());
}