/************************************************************************************//*! \file Font.cxx \author Tng Kah Wei, kahwei.tng, 390009620 \par email: kahwei.tng\@digipen.edu \date Oct 28, 2022 \brief Contains the implementation of the functions of the managed Font class. Note: This file is written in C++17/CLI. Copyright (C) 2022 DigiPen Institute of Technology. Reproduction or disclosure of this file or its contents without the prior written consent of DigiPen Institute of Technology is prohibited. *//*************************************************************************************/ // Precompiled Headers #include "SHpch.h" // Primary Header #include "Font.hxx" // Project Headers #include "Utility/Convert.hxx" namespace SHADE { /*---------------------------------------------------------------------------------*/ /* Properties */ /*---------------------------------------------------------------------------------*/ Handle Font::NativeObject::get() try { return Handle(Convert::ToNative(asset.NativeObjectHandle)); } catch (const BadHandleCastException&) { return Handle(); } GenericHandle Font::NativeObjectHandle::get() { return asset.NativeObjectHandle; } AssetID Font::NativeAssetID::get() { return asset.NativeAssetID; } /*---------------------------------------------------------------------------------*/ /* Constructors/Destructor */ /*---------------------------------------------------------------------------------*/ Font::Font(Handle font) : asset { Handle(font) } {} /*---------------------------------------------------------------------------------*/ /* Operator Overloads */ /*---------------------------------------------------------------------------------*/ Font::operator bool(Font asset) { return asset; } /*---------------------------------------------------------------------------------*/ /* Conversion Operators */ /*---------------------------------------------------------------------------------*/ Font::operator Asset(Font nativeAsset) { return nativeAsset.asset; } Font::operator Font(Asset asset) { return Font(Handle(Convert::ToNative(asset.NativeObjectHandle))); } }