PDFFont.h 504 B

1234567891011121314151617181920212223
  1. /*
  2. * Copyright (c) 2022, Matthew Olsson <mattco@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibPDF/Document.h>
  8. namespace PDF {
  9. class PDFFont : public RefCounted<PDFFont> {
  10. public:
  11. static PDFErrorOr<NonnullRefPtr<PDFFont>> create(Document*, NonnullRefPtr<DictObject>);
  12. virtual ~PDFFont() = default;
  13. virtual u32 char_code_to_code_point(u16 char_code) const = 0;
  14. virtual float get_char_width(u16 char_code, float font_size) const = 0;
  15. };
  16. }