7#include "core/fpdfapi/render/cpdf_type3glyphmap.h"
14#include "core/fxcrt/fx_system.h"
15#include "core/fxge/cfx_glyphbitmap.h"
16#include "core/fxge/fx_font.h"
20constexpr int kType3MaxBlues = 16;
22int AdjustBlueHelper(
float pos, std::vector<
int>* blues) {
23 float min_distance = 1000000.0f;
25 for (
int i = 0; i <
static_cast<
int>(blues->size()); ++i) {
26 float distance = fabs(pos -
static_cast<
float>(blues->at(i)));
27 if (distance <
std::min(0.8f, min_distance)) {
28 min_distance = distance;
33 return blues->at(closest_pos);
35 if (blues->size() < kType3MaxBlues)
36 blues->push_back(new_pos);
47 return std::make_pair(AdjustBlueHelper(top, &m_TopBlue),
48 AdjustBlueHelper(bottom, &m_BottomBlue));
52 auto it = m_GlyphMap.find(charcode);
53 return it != m_GlyphMap.end() ? it->second.get() :
nullptr;
57 std::unique_ptr<CFX_GlyphBitmap> pMap) {
58 m_GlyphMap[charcode] = std::move(pMap);
void SetBitmap(uint32_t charcode, std::unique_ptr< CFX_GlyphBitmap > pMap)
const CFX_GlyphBitmap * GetBitmap(uint32_t charcode) const
std::pair< int, int > AdjustBlue(float top, float bottom)
int FXSYS_roundf(float f)