Change-Id: Idd4e33fa413b9a00391b9c1f57c29404bfa6a0aa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208914 Tested-by: Jenkins Reviewed-by: Khaled Hosny <khaled@libreoffice.org>
53 lines
2.0 KiB
C++
53 lines
2.0 KiB
C++
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
/*
|
|
* This file is part of the LibreOffice project.
|
|
*
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
*
|
|
* This file incorporates work covered by the following license notice:
|
|
*
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
* with this work for additional information regarding copyright
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
* except in compliance with the License. You may obtain a copy of
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <rtl/ustring.hxx>
|
|
#include <tools/gen.hxx>
|
|
#include <o3tl/typed_flags_set.hxx>
|
|
|
|
#include <vcl/dllapi.h>
|
|
|
|
// Translate units from TT to PS (standard 1/1000)
|
|
inline int XUnits(int nUPEM, int n) { return (n * 1000) / nUPEM; }
|
|
|
|
enum class FontType {
|
|
NO_FONT = 0,
|
|
SFNT_TTF = 1<<1, ///< SFNT container with TrueType glyphs
|
|
CFF_FONT = 1<<2, ///< Bare CFF font
|
|
};
|
|
namespace o3tl {
|
|
template<> struct typed_flags<FontType> : is_typed_flags<FontType, 0x06> {};
|
|
}
|
|
|
|
class VCL_DLLPUBLIC FontSubsetInfo final
|
|
{
|
|
public: // TODO: make subsetter results private and provide accessor methods instead
|
|
// subsetter-provided subset details needed by e.g. Postscript or PDF
|
|
OUString m_aPSName;
|
|
int m_nAscent = 0; ///< all metrics in PS font units
|
|
int m_nDescent = 0;
|
|
int m_nCapHeight = 0;
|
|
tools::Rectangle m_aFontBBox;
|
|
FontType m_nFontType = FontType::NO_FONT; ///< font-type of subset result
|
|
};
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|