Path: blob/master/thirdparty/graphite/src/GlyphFace.cpp
9903 views
// SPDX-License-Identifier: MIT OR MPL-2.0 OR LGPL-2.1-or-later OR GPL-2.0-or-later1// Copyright 2010, SIL International, All rights reserved.23#include "inc/GlyphFace.h"456using namespace graphite2;78int32 GlyphFace::getMetric(uint8 metric) const9{10switch (metrics(metric))11{12case kgmetLsb : return int32(m_bbox.bl.x);13case kgmetRsb : return int32(m_advance.x - m_bbox.tr.x);14case kgmetBbTop : return int32(m_bbox.tr.y);15case kgmetBbBottom : return int32(m_bbox.bl.y);16case kgmetBbLeft : return int32(m_bbox.bl.x);17case kgmetBbRight : return int32(m_bbox.tr.x);18case kgmetBbHeight : return int32(m_bbox.tr.y - m_bbox.bl.y);19case kgmetBbWidth : return int32(m_bbox.tr.x - m_bbox.bl.x);20case kgmetAdvWidth : return int32(m_advance.x);21case kgmetAdvHeight : return int32(m_advance.y);22default : return 0;23}24}252627