font_table_linux.h 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. // Copyright 2017 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef PDF_FONT_TABLE_LINUX_H_
  5. #define PDF_FONT_TABLE_LINUX_H_
  6. #include <stddef.h>
  7. #include <stdint.h>
  8. #include <sys/types.h>
  9. namespace pdf {
  10. // GetFontTable loads a specified font table from an open SFNT file.
  11. // fd: a file descriptor to the SFNT file. The position doesn't matter.
  12. // table_tag: the table tag in *big-endian* format, or 0 for the entire font.
  13. // offset: offset into the table or entire font where loading should start.
  14. // The offset must be between 0 and 1 GB - 1.
  15. // output: a buffer of size output_length that gets the data. can be 0, in
  16. // which case output_length will be set to the required size in bytes.
  17. // output_length: size of output, if it's not 0.
  18. //
  19. // returns: true on success.
  20. bool GetFontTable(int fd,
  21. uint32_t table_tag,
  22. off_t offset,
  23. uint8_t* output,
  24. size_t* output_length);
  25. } // namespace pdf
  26. #endif // PDF_FONT_TABLE_LINUX_H_