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
cfx_psfonttracker.cpp
Go to the documentation of this file.
1// Copyright 2021 The PDFium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "core/fxge/win32/cfx_psfonttracker.h"
6
7#include "core/fxge/cfx_font.h"
8#include "third_party/base/check.h"
9#include "third_party/base/containers/contains.h"
10
12
14
16 uint64_t tag = font->GetObjectTag();
17 [[maybe_unused]] bool inserted;
18 if (tag != 0) {
19 inserted = seen_font_tags_.insert(tag).second;
20 } else {
21 inserted = seen_font_ptrs_.insert(UnownedPtr<const CFX_Font>(font)).second;
22 }
23 DCHECK(inserted);
24}
25
26bool CFX_PSFontTracker::SeenFontObject(const CFX_Font* font) const {
27 uint64_t tag = font->GetObjectTag();
28 if (tag != 0)
29 return pdfium::Contains(seen_font_tags_, tag);
30 return pdfium::Contains(seen_font_ptrs_, font);
31}
uint64_t GetObjectTag() const
Definition cfx_font.h:127
bool SeenFontObject(const CFX_Font *font) const
void AddFontObject(const CFX_Font *font)