Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
fpdf_edittext.cpp File Reference

(0ccf980226462398d5097987466bcffd8236e1e9)

#include <map>
#include <memory>
#include <sstream>
#include <utility>
#include <vector>
#include "core/fpdfapi/font/cpdf_cidfont.h"
#include "core/fpdfapi/font/cpdf_font.h"
#include "core/fpdfapi/page/cpdf_docpagedata.h"
#include "core/fpdfapi/page/cpdf_textobject.h"
#include "core/fpdfapi/page/cpdf_textstate.h"
#include "core/fpdfapi/parser/cpdf_array.h"
#include "core/fpdfapi/parser/cpdf_dictionary.h"
#include "core/fpdfapi/parser/cpdf_document.h"
#include "core/fpdfapi/parser/cpdf_name.h"
#include "core/fpdfapi/parser/cpdf_number.h"
#include "core/fpdfapi/parser/cpdf_reference.h"
#include "core/fpdfapi/parser/cpdf_stream.h"
#include "core/fpdfapi/parser/cpdf_string.h"
#include "core/fpdfapi/render/charposlist.h"
#include "core/fpdfapi/render/cpdf_pagerendercontext.h"
#include "core/fpdfapi/render/cpdf_rendercontext.h"
#include "core/fpdfapi/render/cpdf_renderstatus.h"
#include "core/fpdfapi/render/cpdf_textrenderer.h"
#include "core/fpdftext/cpdf_textpage.h"
#include "core/fxcrt/check.h"
#include "core/fxcrt/check_op.h"
#include "core/fxcrt/compiler_specific.h"
#include "core/fxcrt/containers/contains.h"
#include "core/fxcrt/fx_extension.h"
#include "core/fxcrt/fx_memcpy_wrappers.h"
#include "core/fxcrt/fx_string_wrappers.h"
#include "core/fxcrt/numerics/safe_conversions.h"
#include "core/fxcrt/span_util.h"
#include "core/fxcrt/stl_util.h"
#include "core/fxcrt/utf16.h"
#include "core/fxge/cfx_defaultrenderdevice.h"
#include "core/fxge/cfx_fontmgr.h"
#include "core/fxge/dib/cfx_dibitmap.h"
#include "core/fxge/fx_font.h"
#include "core/fxge/text_char_pos.h"
#include "fpdfsdk/cpdfsdk_helpers.h"
#include "public/fpdf_edit.h"
Include dependency graph for fpdf_edittext.cpp:

Go to the source code of this file.

Functions

FPDF_EXPORT FPDF_PAGEOBJECT FPDF_CALLCONV FPDFPageObj_NewTextObj (FPDF_DOCUMENT document, FPDF_BYTESTRING font, float font_size)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFText_SetText (FPDF_PAGEOBJECT text_object, FPDF_WIDESTRING text)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFText_SetCharcodes (FPDF_PAGEOBJECT text_object, const uint32_t *charcodes, size_t count)
FPDF_EXPORT FPDF_FONT FPDF_CALLCONV FPDFText_LoadFont (FPDF_DOCUMENT document, const uint8_t *data, uint32_t size, int font_type, FPDF_BOOL cid)
FPDF_EXPORT FPDF_FONT FPDF_CALLCONV FPDFText_LoadStandardFont (FPDF_DOCUMENT document, FPDF_BYTESTRING font)
FPDF_EXPORT FPDF_FONT FPDF_CALLCONV FPDFText_LoadCidType2Font (FPDF_DOCUMENT document, const uint8_t *font_data, uint32_t font_data_size, FPDF_BYTESTRING to_unicode_cmap, const uint8_t *cid_to_gid_map_data, uint32_t cid_to_gid_map_data_size)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFTextObj_GetFontSize (FPDF_PAGEOBJECT text, float *size)
FPDF_EXPORT unsigned long FPDF_CALLCONV FPDFTextObj_GetText (FPDF_PAGEOBJECT text_object, FPDF_TEXTPAGE text_page, FPDF_WCHAR *buffer, unsigned long length)
FPDF_EXPORT FPDF_BITMAP FPDF_CALLCONV FPDFTextObj_GetRenderedBitmap (FPDF_DOCUMENT document, FPDF_PAGE page, FPDF_PAGEOBJECT text_object, float scale)
FPDF_EXPORT void FPDF_CALLCONV FPDFFont_Close (FPDF_FONT font)
FPDF_EXPORT FPDF_PAGEOBJECT FPDF_CALLCONV FPDFPageObj_CreateTextObj (FPDF_DOCUMENT document, FPDF_FONT font, float font_size)
FPDF_EXPORT FPDF_TEXT_RENDERMODE FPDF_CALLCONV FPDFTextObj_GetTextRenderMode (FPDF_PAGEOBJECT text)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFTextObj_SetTextRenderMode (FPDF_PAGEOBJECT text, FPDF_TEXT_RENDERMODE render_mode)
FPDF_EXPORT FPDF_FONT FPDF_CALLCONV FPDFTextObj_GetFont (FPDF_PAGEOBJECT text)
FPDF_EXPORT size_t FPDF_CALLCONV FPDFFont_GetBaseFontName (FPDF_FONT font, char *buffer, size_t length)
FPDF_EXPORT size_t FPDF_CALLCONV FPDFFont_GetFamilyName (FPDF_FONT font, char *buffer, size_t length)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFFont_GetFontData (FPDF_FONT font, uint8_t *buffer, size_t buflen, size_t *out_buflen)
FPDF_EXPORT int FPDF_CALLCONV FPDFFont_GetIsEmbedded (FPDF_FONT font)
FPDF_EXPORT int FPDF_CALLCONV FPDFFont_GetFlags (FPDF_FONT font)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFFont_GetWeight (FPDF_FONT font)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFFont_GetItalicAngle (FPDF_FONT font, int *angle)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFFont_GetAscent (FPDF_FONT font, float font_size, float *ascent)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFFont_GetDescent (FPDF_FONT font, float font_size, float *descent)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFFont_GetGlyphWidth (FPDF_FONT font, uint32_t glyph, float font_size, float *width)
FPDF_EXPORT FPDF_GLYPHPATH FPDF_CALLCONV FPDFFont_GetGlyphPath (FPDF_FONT font, uint32_t glyph, float font_size)
FPDF_EXPORT int FPDF_CALLCONV FPDFGlyphPath_CountGlyphSegments (FPDF_GLYPHPATH glyphpath)
FPDF_EXPORT FPDF_PATHSEGMENT FPDF_CALLCONV FPDFGlyphPath_GetGlyphPathSegment (FPDF_GLYPHPATH glyphpath, int index)

Function Documentation

◆ FPDFFont_Close()

FPDF_EXPORT void FPDF_CALLCONV FPDFFont_Close ( FPDF_FONT font)

Definition at line 802 of file fpdf_edittext.cpp.

References CPDFFontFromFPDFFont().

Referenced by CheckPDFiumCApi(), and FPDFFontDeleter::operator()().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FPDFFont_GetAscent()

FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFFont_GetAscent ( FPDF_FONT font,
float font_size,
float * ascent )

Definition at line 937 of file fpdf_edittext.cpp.

References CPDFFontFromFPDFFont(), and CPDF_Font::GetTypeAscent().

Referenced by CheckPDFiumCApi(), and TEST_F().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FPDFFont_GetBaseFontName()

FPDF_EXPORT size_t FPDF_CALLCONV FPDFFont_GetBaseFontName ( FPDF_FONT font,
char * buffer,
size_t length )

Definition at line 858 of file fpdf_edittext.cpp.

References CPDFFontFromFPDFFont(), and CPDF_Font::GetBaseFontName().

Referenced by CheckPDFiumCApi().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FPDFFont_GetDescent()

FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFFont_GetDescent ( FPDF_FONT font,
float font_size,
float * descent )

Definition at line 948 of file fpdf_edittext.cpp.

References CPDFFontFromFPDFFont(), and CPDF_Font::GetTypeDescent().

Referenced by CheckPDFiumCApi(), and TEST_F().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FPDFFont_GetFamilyName()

FPDF_EXPORT size_t FPDF_CALLCONV FPDFFont_GetFamilyName ( FPDF_FONT font,
char * buffer,
size_t length )

Definition at line 874 of file fpdf_edittext.cpp.

References CPDFFontFromFPDFFont(), CFX_Font::GetFamilyName(), and CPDF_Font::GetFont().

Referenced by CheckPDFiumCApi().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FPDFFont_GetFlags()

FPDF_EXPORT int FPDF_CALLCONV FPDFFont_GetFlags ( FPDF_FONT font)

Definition at line 913 of file fpdf_edittext.cpp.

References CPDFFontFromFPDFFont(), and CPDF_Font::GetFontFlags().

Referenced by CheckPDFiumCApi(), and TEST_F().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FPDFFont_GetFontData()

FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFFont_GetFontData ( FPDF_FONT font,
uint8_t * buffer,
size_t buflen,
size_t * out_buflen )

Definition at line 890 of file fpdf_edittext.cpp.

References CPDFFontFromFPDFFont(), and CPDF_Font::GetFont().

Referenced by CheckPDFiumCApi().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FPDFFont_GetGlyphPath()

FPDF_EXPORT FPDF_GLYPHPATH FPDF_CALLCONV FPDFFont_GetGlyphPath ( FPDF_FONT font,
uint32_t glyph,
float font_size )

Definition at line 981 of file fpdf_edittext.cpp.

References CPDF_Font::CharCodeFromUnicode(), CPDFFontFromFPDFFont(), CPDF_Font::GetFont(), CPDF_Font::GetFontFallback(), and CFX_Font::LoadGlyphPath().

Referenced by CheckPDFiumCApi(), TEST_F(), and TEST_F().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FPDFFont_GetGlyphWidth()

FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFFont_GetGlyphWidth ( FPDF_FONT font,
uint32_t glyph,
float font_size,
float * width )

Definition at line 959 of file fpdf_edittext.cpp.

References CPDF_Font::AsCIDFont(), CPDF_Font::CharCodeFromUnicode(), CPDF_CIDFont::CIDFromCharCode(), CPDFFontFromFPDFFont(), CPDF_Font::GetCharWidthF(), CPDF_CIDFont::GetVertWidth(), and CPDF_CIDFont::IsVertWriting().

Referenced by CheckPDFiumCApi(), and TEST_F().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FPDFFont_GetIsEmbedded()

FPDF_EXPORT int FPDF_CALLCONV FPDFFont_GetIsEmbedded ( FPDF_FONT font)

Definition at line 906 of file fpdf_edittext.cpp.

References CPDFFontFromFPDFFont(), and CPDF_Font::IsEmbedded().

Referenced by CheckPDFiumCApi(), TEST_F(), and TEST_F().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FPDFFont_GetItalicAngle()

FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFFont_GetItalicAngle ( FPDF_FONT font,
int * angle )

Definition at line 927 of file fpdf_edittext.cpp.

References CPDFFontFromFPDFFont(), and CPDF_Font::GetItalicAngle().

Referenced by CheckPDFiumCApi(), and TEST_F().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FPDFFont_GetWeight()

FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFFont_GetWeight ( FPDF_FONT font)

Definition at line 922 of file fpdf_edittext.cpp.

References CPDFFontFromFPDFFont(), and CPDF_Font::GetFontWeight().

Referenced by CheckPDFiumCApi(), and TEST_F().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FPDFGlyphPath_CountGlyphSegments()

FPDF_EXPORT int FPDF_CALLCONV FPDFGlyphPath_CountGlyphSegments ( FPDF_GLYPHPATH glyphpath)

Definition at line 1014 of file fpdf_edittext.cpp.

Referenced by CheckPDFiumCApi(), and TEST_F().

Here is the caller graph for this function:

◆ FPDFGlyphPath_GetGlyphPathSegment()

FPDF_EXPORT FPDF_PATHSEGMENT FPDF_CALLCONV FPDFGlyphPath_GetGlyphPathSegment ( FPDF_GLYPHPATH glyphpath,
int index )

Definition at line 1023 of file fpdf_edittext.cpp.

Referenced by CheckPDFiumCApi(), and TEST_F().

Here is the caller graph for this function:

◆ FPDFPageObj_CreateTextObj()

FPDF_EXPORT FPDF_PAGEOBJECT FPDF_CALLCONV FPDFPageObj_CreateTextObj ( FPDF_DOCUMENT document,
FPDF_FONT font,
float font_size )

Definition at line 808 of file fpdf_edittext.cpp.

References CPDFDocumentFromFPDFDocument(), CPDFFontFromFPDFFont(), CPDF_DocPageData::FromDocument(), and CPDF_DocPageData::GetFont().

Referenced by CheckPDFiumCApi().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FPDFPageObj_NewTextObj()

FPDF_EXPORT FPDF_PAGEOBJECT FPDF_CALLCONV FPDFPageObj_NewTextObj ( FPDF_DOCUMENT document,
FPDF_BYTESTRING font,
float font_size )

Definition at line 569 of file fpdf_edittext.cpp.

References CPDFDocumentFromFPDFDocument().

Referenced by CheckPDFiumCApi().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FPDFText_LoadCidType2Font()

FPDF_EXPORT FPDF_FONT FPDF_CALLCONV FPDFText_LoadCidType2Font ( FPDF_DOCUMENT document,
const uint8_t * font_data,
uint32_t font_data_size,
FPDF_BYTESTRING to_unicode_cmap,
const uint8_t * cid_to_gid_map_data,
uint32_t cid_to_gid_map_data_size )

Definition at line 666 of file fpdf_edittext.cpp.

References CPDFDocumentFromFPDFDocument().

Referenced by CheckPDFiumCApi().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FPDFText_LoadFont()

FPDF_EXPORT FPDF_FONT FPDF_CALLCONV FPDFText_LoadFont ( FPDF_DOCUMENT document,
const uint8_t * data,
uint32_t size,
int font_type,
FPDF_BOOL cid )

Definition at line 628 of file fpdf_edittext.cpp.

References CPDFDocumentFromFPDFDocument().

Referenced by CheckPDFiumCApi().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FPDFText_LoadStandardFont()

FPDF_EXPORT FPDF_FONT FPDF_CALLCONV FPDFText_LoadStandardFont ( FPDF_DOCUMENT document,
FPDF_BYTESTRING font )

Definition at line 655 of file fpdf_edittext.cpp.

References CPDFDocumentFromFPDFDocument(), and CPDF_Font::GetStockFont().

Referenced by CheckPDFiumCApi().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FPDFText_SetCharcodes()

FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFText_SetCharcodes ( FPDF_PAGEOBJECT text_object,
const uint32_t * charcodes,
size_t count )

Definition at line 608 of file fpdf_edittext.cpp.

References CPDF_TextObject::SetText().

Referenced by CheckPDFiumCApi().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FPDFText_SetText()

FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFText_SetText ( FPDF_PAGEOBJECT text_object,
FPDF_WIDESTRING text )

Definition at line 591 of file fpdf_edittext.cpp.

References CPDF_TextObject::SetText(), and WideStringFromFPDFWideString().

Referenced by CheckPDFiumCApi().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FPDFTextObj_GetFont()

FPDF_EXPORT FPDF_FONT FPDF_CALLCONV FPDFTextObj_GetFont ( FPDF_PAGEOBJECT text)

Definition at line 849 of file fpdf_edittext.cpp.

References CPDF_TextObject::GetFont().

Referenced by CheckPDFiumCApi(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FPDFTextObj_GetFontSize()

FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFTextObj_GetFontSize ( FPDF_PAGEOBJECT text,
float * size )

Definition at line 701 of file fpdf_edittext.cpp.

References CPDF_TextObject::GetFontSize().

Referenced by CheckPDFiumCApi(), TEST_F(), TEST_F(), and TEST_F().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FPDFTextObj_GetRenderedBitmap()

FPDF_EXPORT FPDF_BITMAP FPDF_CALLCONV FPDFTextObj_GetRenderedBitmap ( FPDF_DOCUMENT document,
FPDF_PAGE page,
FPDF_PAGEOBJECT text_object,
float scale )

Definition at line 733 of file fpdf_edittext.cpp.

References CFX_Matrix::CFX_Matrix(), CPDF_Page::RenderContextClearer::RenderContextClearer(), CFX_DefaultRenderDevice::Attach(), CPDFDocumentFromFPDFDocument(), CPDFPageFromFPDFPage(), CPDF_Page::GetDocument(), CFX_FloatRect::GetOuterRect(), CPDF_PageObject::GetRect(), FX_RECT::Height(), CPDF_RenderStatus::Initialize(), FX_RECT::IsEmpty(), kBgra, CFX_FloatRect::left, CFX_Matrix::operator*=(), CPDF_RenderStatus::RenderSingleObject(), CPDF_RenderStatus::SetDeviceMatrix(), CFX_FloatRect::top, CFX_Matrix::TransformRect(), and FX_RECT::Width().

Referenced by CheckPDFiumCApi().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FPDFTextObj_GetText()

FPDF_EXPORT unsigned long FPDF_CALLCONV FPDFTextObj_GetText ( FPDF_PAGEOBJECT text_object,
FPDF_TEXTPAGE text_page,
FPDF_WCHAR * buffer,
unsigned long length )

Definition at line 714 of file fpdf_edittext.cpp.

References CPDFTextPageFromFPDFTextPage().

Referenced by CheckPDFiumCApi(), and TEST_F().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FPDFTextObj_GetTextRenderMode()

FPDF_EXPORT FPDF_TEXT_RENDERMODE FPDF_CALLCONV FPDFTextObj_GetTextRenderMode ( FPDF_PAGEOBJECT text)

Definition at line 826 of file fpdf_edittext.cpp.

References CPDF_TextObject::GetTextRenderMode().

Referenced by CheckPDFiumCApi(), TEST_F(), TEST_F(), and TEST_F().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FPDFTextObj_SetTextRenderMode()

FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFTextObj_SetTextRenderMode ( FPDF_PAGEOBJECT text,
FPDF_TEXT_RENDERMODE render_mode )

Definition at line 834 of file fpdf_edittext.cpp.

References CPDF_TextObject::SetTextRenderMode().

Referenced by CheckPDFiumCApi(), and TEST_F().

Here is the call graph for this function:
Here is the caller graph for this function: