blob: 1398de677b86b4d1f1ac5aa5b7da697dd96f2988 [file] [log] [blame]
bungeman@google.com8ec99562012-02-07 21:30:21 +00001/*
2 * Copyright 2012 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef SkOTUtils_DEFINED
9#define SkOTUtils_DEFINED
10
11#include "SkOTTableTypes.h"
bungeman@google.coma5501992012-05-18 19:06:41 +000012class SkStream;
bungeman@google.com8ec99562012-02-07 21:30:21 +000013
14struct SkOTUtils {
bungeman@google.coma5501992012-05-18 19:06:41 +000015 /**
16 * Calculates the OpenType checksum for data.
17 */
bungeman@google.com8ec99562012-02-07 21:30:21 +000018 static uint32_t CalcTableChecksum(SK_OT_ULONG *data, size_t length);
bungeman@google.coma5501992012-05-18 19:06:41 +000019
20 /**
21 * Renames an sfnt font. On failure (invalid data or not an sfnt font)
22 * returns NULL.
23 *
24 * Essentially, this removes any existing 'name' table and replaces it
25 * with a new one in which FontFamilyName, FontSubfamilyName,
26 * UniqueFontIdentifier, FullFontName, and PostscriptName are fontName.
27 *
28 * The new 'name' table records will be written with the Windows,
29 * UnicodeBMPUCS2, and English_UnitedStates settings.
30 *
31 * fontName and fontNameLen must be specified in terms of ASCII chars.
32 */
33 static SkData* RenameFont(SkStream* fontData,
34 const char* fontName, int fontNameLen);
bungeman@google.com8ec99562012-02-07 21:30:21 +000035};
36
37#endif