diff --git a/Client/game_sa/CAnimManagerSA.cpp b/Client/game_sa/CAnimManagerSA.cpp index b9e5ba9e76..d540fa16af 100644 --- a/Client/game_sa/CAnimManagerSA.cpp +++ b/Client/game_sa/CAnimManagerSA.cpp @@ -1,11 +1,11 @@ /***************************************************************************** * - * PROJECT: Multi Theft Auto v1.0 + * PROJECT: Multi Theft Auto * LICENSE: See LICENSE in the top level directory - * FILE: game_sa/CAnimManagerSA.cpp + * FILE: Client/game_sa/CAnimManagerSA.cpp * PURPOSE: Animation manager * - * Multi Theft Auto is available from http://www.multitheftauto.com/ + * Multi Theft Auto is available from https://multitheftauto.com/ * *****************************************************************************/ @@ -21,7 +21,14 @@ extern CGameSA* pGame; -using std::list; +// This "gateway" animation will allow us to play custom animations by simply playing this animation +// and then in AddAnimation and AddAnimationAndSync hook, we can return our custom animation in the +// hook instead of run_wuzi. This will trick GTA SA into thinking that it is playing run_wuzi from +// ped block, but in reality, it's playing our custom animation, and Of course, we can return run_wuzi +// animation within the hook if we want to play it instead. Why run_wuzi? We can also use another animation, +// but I've tested with this one mostly, so let's stick to this. +static const char* const kGateWayBlockName = "ped"; +static const char* const kGateWayAnimationName = "run_wuzi"; CAnimManagerSA::CAnimManagerSA() { @@ -195,7 +202,7 @@ int CAnimManagerSA::RegisterAnimBlock(const char* szName) return iReturn; } -std::unique_ptr CAnimManagerSA::GetAnimBlendAssoc(AssocGroupId groupID) +std::unique_ptr CAnimManagerSA::GetAnimBlendAssoc(AssocGroupId groupID) const { CAnimBlendAssocGroupSAInterface* pInterface = nullptr; DWORD dwFunc = FUNC_CAnimManager_GetAnimBlendAssoc; @@ -274,8 +281,12 @@ std::unique_ptr CAnimManagerSA::CreateAnimAssociation(Ass return nullptr; } -CAnimManagerSA::StaticAssocIntface_type CAnimManagerSA::GetAnimStaticAssociation(eAnimGroup animGroup, eAnimID animID) +CAnimManagerSA::StaticAssocIntface_type CAnimManagerSA::GetAnimStaticAssociation(eAnimGroup animGroup, eAnimID animID) const { + // We check the validity of the group, avoid crashes due to an invalid group + if (!IsValidGroup(static_cast(animGroup))) + return nullptr; + CAnimBlendStaticAssociationSAInterface* pInterface = nullptr; DWORD dwFunc = FUNC_CAnimManager_GetAnimAssociation; _asm @@ -295,6 +306,10 @@ CAnimManagerSA::StaticAssocIntface_type CAnimManagerSA::GetAnimStaticAssociation std::unique_ptr CAnimManagerSA::GetAnimAssociation(AssocGroupId animGroup, const char* szAnimName) { + // We check the validity of the group, avoid crashes due to an invalid group + if (!IsValidGroup(animGroup)) + return nullptr; + CAnimBlendAssociationSAInterface* pInterface = nullptr; DWORD dwFunc = FUNC_CAnimManager_GetAnimAssociation_str; _asm @@ -363,7 +378,7 @@ std::unique_ptr CAnimManagerSA::AddAnimationAndSync(RpClu AnimationId animID) { if (!pClump) - return NULL; + return nullptr; CAnimBlendAssociationSAInterface* pInterface = nullptr; DWORD dwFunc = FUNC_CAnimManager_AddAnimationAndSync; @@ -387,8 +402,8 @@ std::unique_ptr CAnimManagerSA::AddAnimationAndSync(RpClu std::unique_ptr CAnimManagerSA::BlendAnimation(RpClump* pClump, AssocGroupId animGroup, AnimationId animID, float fBlendDelta) { - if (!pClump) - return NULL; + if (!pClump || !IsValidAnim(animGroup, animID)) + return nullptr; CAnimBlendAssociationSAInterface* pInterface = nullptr; DWORD dwFunc = FUNC_CAnimManager_BlendAnimation; @@ -495,7 +510,10 @@ void CAnimManagerSA::RemoveAnimBlock(int ID) AnimAssocDefinition* CAnimManagerSA::AddAnimAssocDefinition(const char* szBlockName, const char* szAnimName, AssocGroupId animGroup, AnimationId animID, AnimDescriptor* pDescriptor) { - AnimAssocDefinition* pReturn; + if (!IsValidAnim(animGroup, animID)) + return nullptr; + + AnimAssocDefinition* pReturn{}; DWORD dwFunc = FUNC_CAnimManager_AddAnimAssocDefinition; _asm { @@ -508,7 +526,7 @@ AnimAssocDefinition* CAnimManagerSA::AddAnimAssocDefinition(const char* szBlockN mov pReturn, eax add esp, 0x14 } - return NULL; + return pReturn; } void CAnimManagerSA::ReadAnimAssociationDefinitions() @@ -849,5 +867,33 @@ void CAnimManagerSA::DeleteCustomAnimSequenceInterface(CAnimBlendSequenceSAInter bool CAnimManagerSA::isGateWayAnimationHierarchy(CAnimBlendHierarchySAInterface* pInterface) { - return pGame->GetKeyGen()->GetUppercaseKey(m_kGateWayAnimationName.c_str()) == pInterface->uiHashKey; + return pGame->GetKeyGen()->GetUppercaseKey(kGateWayAnimationName) == pInterface->uiHashKey; +} + +const char* CAnimManagerSA::GetGateWayBlockName() const +{ + return kGateWayBlockName; +} + +const char* CAnimManagerSA::GetGateWayAnimationName() const +{ + return kGateWayAnimationName; +} + +bool CAnimManagerSA::IsValidGroup(std::uint32_t uiAnimGroup) const +{ + const auto pGroup = GetAnimBlendAssoc(uiAnimGroup); + return pGroup && pGroup->IsCreated(); +} + +bool CAnimManagerSA::IsValidAnim(std::uint32_t uiAnimGroup, std::uint32_t uiAnimID) const +{ + // We get an animation for the checks + const auto pAnim = GetAnimStaticAssociation((eAnimGroup)uiAnimGroup, (eAnimID)uiAnimID); + if (!pAnim) + return false; + + // We check the interface and sAnimID, if AnimID is not in GTA:SA, it will differ from our indicators in sAnimID + const auto pInterface = pAnim->GetInterface(); + return pInterface && pInterface->sAnimID == uiAnimID; } diff --git a/Client/game_sa/CAnimManagerSA.h b/Client/game_sa/CAnimManagerSA.h index e826138b62..bb29059fac 100644 --- a/Client/game_sa/CAnimManagerSA.h +++ b/Client/game_sa/CAnimManagerSA.h @@ -1,11 +1,11 @@ /***************************************************************************** * - * PROJECT: Multi Theft Auto v1.0 + * PROJECT: Multi Theft Auto * LICENSE: See LICENSE in the top level directory - * FILE: game_sa/CAnimManagerSA.h + * FILE: Client/game_sa/CAnimManagerSA.h * PURPOSE: Header file for animation manager class * - * Multi Theft Auto is available from http://www.multitheftauto.com/ + * Multi Theft Auto is available from https://multitheftauto.com/ * *****************************************************************************/ @@ -94,14 +94,14 @@ class CAnimManagerSA : public CAnimManager int GetAnimationBlockIndex(const char* szName); int RegisterAnimBlock(const char* szName); - std::unique_ptr GetAnimBlendAssoc(AssocGroupId groupID); + std::unique_ptr GetAnimBlendAssoc(AssocGroupId groupID) const; AssocGroupId GetFirstAssocGroup(const char* szName); const char* GetAnimGroupName(AssocGroupId groupID); const char* GetAnimBlockName(AssocGroupId groupID); std::unique_ptr CreateAnimAssociation(AssocGroupId animGroup, AnimationId animID); - StaticAssocIntface_type GetAnimStaticAssociation(eAnimGroup animGroup, eAnimID animID); + StaticAssocIntface_type GetAnimStaticAssociation(eAnimGroup animGroup, eAnimID animID) const; std::unique_ptr GetAnimAssociation(AssocGroupId animGroup, const char* szAnimName); std::unique_ptr AddAnimation(RpClump* pClump, AssocGroupId animGroup, AnimationId animID); std::unique_ptr AddAnimation(RpClump* pClump, CAnimBlendHierarchy*, int ID); @@ -159,20 +159,13 @@ class CAnimManagerSA : public CAnimManager void DeleteCustomAnimHierarchyInterface(CAnimBlendHierarchySAInterface* pInterface); void DeleteCustomAnimSequenceInterface(CAnimBlendSequenceSAInterface* pInterface); - bool isGateWayAnimationHierarchy(CAnimBlendHierarchySAInterface* pInterface); - const SString& GetGateWayBlockName() { return m_kGateWayBlockName; }; - const SString& GetGateWayAnimationName() { return m_kGateWayAnimationName; }; + bool isGateWayAnimationHierarchy(CAnimBlendHierarchySAInterface* pInterface); + const char* GetGateWayBlockName() const; + const char* GetGateWayAnimationName() const; + bool IsValidGroup(std::uint32_t uiAnimGroup) const; + bool IsValidAnim(std::uint32_t uiAnimGroup, std::uint32_t uiAnimID) const; private: CAnimBlendAssocGroup* m_pAnimAssocGroups[MAX_ANIM_GROUPS]; CAnimBlock* m_pAnimBlocks[MAX_ANIM_BLOCKS]; - - // This "gateway" animation will allow us to play custom animations by simply playing this animation - // and then in AddAnimation and AddAnimationAndSync hook, we can return our custom animation in the - // hook instead of run_wuzi. This will trick GTA SA into thinking that it is playing run_wuzi from - // ped block, but in reality, it's playing our custom animation, and Of course, we can return run_wuzi - // animation within the hook if we want to play it instead. Why run_wuzi? We can also use another animation, - // but I've tested with this one mostly, so let's stick to this. - const SString m_kGateWayBlockName = "ped"; - const SString m_kGateWayAnimationName = "run_wuzi"; }; diff --git a/Client/game_sa/CBuildingRemovalSA.cpp b/Client/game_sa/CBuildingRemovalSA.cpp index 71bcef92b6..122a1bba45 100644 --- a/Client/game_sa/CBuildingRemovalSA.cpp +++ b/Client/game_sa/CBuildingRemovalSA.cpp @@ -716,4 +716,10 @@ void CBuildingRemovalSA::DropCaches() m_pBinaryBuildings->clear(); m_pDataBuildings->clear(); + + for (auto &pRemoval : *m_pBuildingRemovals) + { + pRemoval.second->m_pDataRemoveList->clear(); + pRemoval.second->m_pBinaryRemoveList->clear(); + } } diff --git a/Client/game_sa/CCheckpointSA.cpp b/Client/game_sa/CCheckpointSA.cpp index a7ebe0d263..0528dbb2ef 100644 --- a/Client/game_sa/CCheckpointSA.cpp +++ b/Client/game_sa/CCheckpointSA.cpp @@ -13,6 +13,10 @@ #include "C3DMarkerSA.h" #include "C3DMarkersSA.h" #include "CCheckpointSA.h" +#include "CCheckpointsSA.h" +#include "CGameSA.h" + +extern CGameSA* pGame; void CCheckpointSA::SetPosition(CVector* vecPosition) { @@ -132,3 +136,39 @@ void CCheckpointSA::Remove() GetInterface()->m_nType = 257; GetInterface()->rwColour = 0; } + +void CCheckpointSA::SetTargetArrowData(const SColor color, float size) noexcept +{ + m_targetArrowColor = color; + m_targetArrowSize = size; +} + +static void __cdecl RenderTargetArrow(CCheckpointSAInterface* pCheckpoint) +{ + CCheckpoint* checkpoint = pGame->GetCheckpoints()->FindMarker(pCheckpoint->m_nIdentifier); + if (!checkpoint) + return; + + CVector* position = checkpoint->GetPosition(); + CVector* direction = checkpoint->GetPointDirection(); + SColor color = checkpoint->GetTargetArrowColor(); + + ((void(__cdecl*)(float, float, float, float, std::uint8_t, std::uint8_t, std::uint8_t, std::uint8_t, float, float, float))C3dMarkers_DirectionArrowSet)(position->fX, position->fY, position->fZ, checkpoint->GetTargetArrowSize(), color.R, color.G, color.B, color.A, -direction->fX, -direction->fY, -direction->fZ); +} + +static void _declspec(naked) HOOK_CCheckpoint__Render() +{ + _asm { + pushad + push esi + call RenderTargetArrow + add esp, 4 + popad + jmp RETURN_CCheckpoint__Render + } +} + +void CCheckpointSA::StaticSetHooks() +{ + EZHookInstall(CCheckpoint__Render); +} diff --git a/Client/game_sa/CCheckpointSA.h b/Client/game_sa/CCheckpointSA.h index 539bf22c93..f06007edbb 100644 --- a/Client/game_sa/CCheckpointSA.h +++ b/Client/game_sa/CCheckpointSA.h @@ -14,6 +14,12 @@ #include #include +#define HOOKPOS_CCheckpoint__Render 0x725E56 +#define HOOKSIZE_CCheckpoint__Render 0x5 +static constexpr std::uint32_t RETURN_CCheckpoint__Render = 0x725E5B; + +#define C3dMarkers_DirectionArrowSet 0x721140 + class CCheckpointSAInterface { public: @@ -36,12 +42,16 @@ class CCheckpointSA : public CCheckpoint { private: CCheckpointSAInterface* internalInterface; + SColor m_targetArrowColor{0xFFFF4040}; + float m_targetArrowSize{0.625f}; public: CCheckpointSA(CCheckpointSAInterface* checkpointInterface) { internalInterface = checkpointInterface; }; CCheckpointSAInterface* GetInterface() { return internalInterface; } + static void StaticSetHooks(); + void SetPosition(CVector* vecPosition); CVector* GetPosition(); void SetPointDirection(CVector* vecPointDirection); @@ -62,4 +72,7 @@ class CCheckpointSA : public CCheckpoint void SetPulseFraction(float fPulseFraction); // doesn't work propperly (not virtualed) float GetPulseFraction(); void Remove(); + SColor GetTargetArrowColor() const noexcept override { return m_targetArrowColor; }; + float GetTargetArrowSize() const noexcept override { return m_targetArrowSize; }; + void SetTargetArrowData(const SColor color, float size) noexcept; }; diff --git a/Client/game_sa/CCheckpointsSA.cpp b/Client/game_sa/CCheckpointsSA.cpp index e0f83f5de5..593d295340 100644 --- a/Client/game_sa/CCheckpointsSA.cpp +++ b/Client/game_sa/CCheckpointsSA.cpp @@ -66,3 +66,14 @@ CCheckpoint* CCheckpointsSA::FindFreeMarker() } return NULL; } + +CCheckpoint* CCheckpointsSA::FindMarker(DWORD identifier) +{ + for (CCheckpointSA* checkpoint : Checkpoints) + { + if (checkpoint->GetIdentifier() == identifier) + return checkpoint; + } + + return nullptr; +} diff --git a/Client/game_sa/CCheckpointsSA.h b/Client/game_sa/CCheckpointsSA.h index 151af329ab..c29c21f6af 100644 --- a/Client/game_sa/CCheckpointsSA.h +++ b/Client/game_sa/CCheckpointsSA.h @@ -35,4 +35,5 @@ class CCheckpointsSA : public CCheckpoints CCheckpoint* CreateCheckpoint(DWORD Identifier, WORD wType, CVector* vecPosition, CVector* vecPointDir, float fSize, float fPulseFraction, const SharedUtil::SColor color); CCheckpoint* FindFreeMarker(); + CCheckpoint* FindMarker(DWORD identifier); }; diff --git a/Client/game_sa/CGameSA.cpp b/Client/game_sa/CGameSA.cpp index a65e84a1f6..abfb822816 100644 --- a/Client/game_sa/CGameSA.cpp +++ b/Client/game_sa/CGameSA.cpp @@ -58,6 +58,7 @@ #include "D3DResourceSystemSA.h" #include "CIplStoreSA.h" #include "CBuildingRemovalSA.h" +#include "CCheckpointSA.h" extern CGameSA* pGame; @@ -238,6 +239,7 @@ CGameSA::CGameSA() CFileLoaderSA::StaticSetHooks(); D3DResourceSystemSA::StaticSetHooks(); CVehicleSA::StaticSetHooks(); + CCheckpointSA::StaticSetHooks(); } CGameSA::~CGameSA() @@ -664,7 +666,7 @@ void CGameSA::SetCoronaZTestEnabled(bool isEnabled) m_isCoronaZTestEnabled = isEnabled; } -void CGameSA::SetWaterCreaturesEnabled(bool isEnabled) +void CGameSA::SetWaterCreaturesEnabled(bool isEnabled) { if (isEnabled == m_areWaterCreaturesEnabled) return; @@ -684,6 +686,29 @@ void CGameSA::SetWaterCreaturesEnabled(bool isEnabled) m_areWaterCreaturesEnabled = isEnabled; } +void CGameSA::SetTunnelWeatherBlendEnabled(bool isEnabled) +{ + if (isEnabled == m_isTunnelWeatherBlendEnabled) + return; + // CWeather::UpdateInTunnelness + DWORD functionAddress = 0x72B630; + if (isEnabled) + { + // Restore original bytes: 83 EC 20 + MemPut(functionAddress, 0x83); // Restore 83 + MemPut(functionAddress + 1, 0xEC); // Restore EC + MemPut(functionAddress + 2, 0x20); // Restore 20 + } + else + { + // Patch CWeather::UpdateInTunnelness (Found By AlexTMjugador) + MemPut(functionAddress, 0xC3); // Write C3 (RET) + MemPut(functionAddress + 1, 0x90); // Write 90 (NOP) + MemPut(functionAddress + 2, 0x90); // Write 90 (NOP) + } + m_isTunnelWeatherBlendEnabled = isEnabled; +} + void CGameSA::SetBurnFlippedCarsEnabled(bool isEnabled) { if (isEnabled == m_isBurnFlippedCarsEnabled) @@ -980,12 +1005,20 @@ void CGameSA::GetShaderReplacementStats(SShaderReplacementStats& outStats) m_pRenderWare->GetShaderReplacementStats(outStats); } -void CGameSA::RemoveAllBuildings() +void CGameSA::RemoveAllBuildings(bool clearBuildingRemoval) { m_pIplStore->SetDynamicIplStreamingEnabled(false); m_pPools->GetDummyPool().RemoveAllBuildingLods(); m_pPools->GetBuildingsPool().RemoveAllBuildings(); + + auto pBuildingRemoval = static_cast(m_pBuildingRemoval); + if (clearBuildingRemoval) + { + pBuildingRemoval->ClearRemovedBuildingLists(); + } + pBuildingRemoval->DropCaches(); + m_isBuildingsRemoved = true; } @@ -1003,10 +1036,13 @@ bool CGameSA::SetBuildingPoolSize(size_t size) const bool shouldRemoveBuilding = !m_isBuildingsRemoved; if (shouldRemoveBuilding) { - RemoveAllBuildings(); + RemoveAllBuildings(false); + } + else + { + static_cast(m_pBuildingRemoval)->DropCaches(); } - ((CBuildingRemovalSA*)GetBuildingRemoval())->DropCaches(); bool status = m_pPools->GetBuildingsPool().Resize(size); if (shouldRemoveBuilding) diff --git a/Client/game_sa/CGameSA.h b/Client/game_sa/CGameSA.h index 29d9a9ef73..f22b5748f7 100644 --- a/Client/game_sa/CGameSA.h +++ b/Client/game_sa/CGameSA.h @@ -244,6 +244,10 @@ class CGameSA : public CGame bool IsRoadSignsTextEnabled() const noexcept override { return m_isRoadSignsTextEnabled; } void SetRoadSignsTextEnabled(bool isEnabled) override; + bool IsTunnelWeatherBlendEnabled() const noexcept override { return m_isTunnelWeatherBlendEnabled; } + void SetTunnelWeatherBlendEnabled(bool isEnabled) override; + + unsigned long GetMinuteDuration(); void SetMinuteDuration(unsigned long ulTime); @@ -299,7 +303,7 @@ class CGameSA : public CGame PostWeaponFireHandler* m_pPostWeaponFireHandler; TaskSimpleBeHitHandler* m_pTaskSimpleBeHitHandler; - void RemoveAllBuildings(); + void RemoveAllBuildings(bool clearBuildingRemoval = true); void RestoreGameBuildings(); bool SetBuildingPoolSize(size_t size); @@ -363,6 +367,7 @@ class CGameSA : public CGame int m_iCheckStatus; bool m_bUnderworldWarp; bool m_isCoronaZTestEnabled{true}; + bool m_isTunnelWeatherBlendEnabled{true}; bool m_areWaterCreaturesEnabled{true}; bool m_isBurnFlippedCarsEnabled{true}; bool m_isFireballDestructEnabled{true}; diff --git a/Client/game_sa/CHandlingManagerSA.cpp b/Client/game_sa/CHandlingManagerSA.cpp index 94e05e0fae..cf37268e96 100644 --- a/Client/game_sa/CHandlingManagerSA.cpp +++ b/Client/game_sa/CHandlingManagerSA.cpp @@ -1,11 +1,11 @@ /***************************************************************************** * - * PROJECT: Multi Theft Auto v1.0 + * PROJECT: Multi Theft Auto * LICENSE: See LICENSE in the top level directory - * FILE: game_sa/CHandlingManagerSA.cpp + * FILE: Client/game_sa/CHandlingManagerSA.cpp * PURPOSE: Vehicle handling manager * - * Multi Theft Auto is available from http://www.multitheftauto.com/ + * Multi Theft Auto is available from https://multitheftauto.com/ * *****************************************************************************/ @@ -13,8 +13,10 @@ #include #include #include "CHandlingManagerSA.h" +#include "CGameSA.h" extern CCoreInterface* g_pCore; +extern CGameSA* pGame; #define ARRAY_HANDLINGDATA 0xC2B9DC @@ -117,6 +119,12 @@ __declspec(naked) void Hook_Calculate() } } +static bool IsVehicleModel(eVehicleTypes eModel) +{ + const auto pModelInfo = pGame->GetModelInfo(eModel); + return pModelInfo && pModelInfo->IsVehicle(); +} + CHandlingManagerSA::CHandlingManagerSA() { // Initialize all default handlings @@ -206,104 +214,88 @@ CHandlingManagerSA::~CHandlingManagerSA() } } -eHandlingProperty CHandlingManagerSA::GetPropertyEnumFromName(std::string strName) +eHandlingProperty CHandlingManagerSA::GetPropertyEnumFromName(const std::string& strName) { - std::map::iterator it; - it = m_HandlingNames.find(strName); - - if (it != m_HandlingNames.end()) - { - return it->second; - } - return HANDLING_MAX; + const auto it = m_HandlingNames.find(strName); + return it != m_HandlingNames.end() ? it->second : HANDLING_MAX; } CHandlingEntry* CHandlingManagerSA::CreateHandlingData() { - CHandlingEntrySA* pHandlingEntry = new CHandlingEntrySA(); - return pHandlingEntry; + return new CHandlingEntrySA; } CFlyingHandlingEntry* CHandlingManagerSA::CreateFlyingHandlingData() { - CFlyingHandlingEntrySA* pFlyingHandlingEntry = new CFlyingHandlingEntrySA(); - return pFlyingHandlingEntry; + return new CFlyingHandlingEntrySA; } CBoatHandlingEntry* CHandlingManagerSA::CreateBoatHandlingData() { - CBoatHandlingEntrySA* pBoatHandlingEntry = new CBoatHandlingEntrySA(); - return pBoatHandlingEntry; + return new CBoatHandlingEntrySA; } CBikeHandlingEntry* CHandlingManagerSA::CreateBikeHandlingData() { - CBikeHandlingEntrySA* pBikeHandlingEntry = new CBikeHandlingEntrySA(); - return pBikeHandlingEntry; + return new CBikeHandlingEntrySA; } const CHandlingEntry* CHandlingManagerSA::GetOriginalHandlingData(eVehicleTypes eModel) { - // Within range? - if (eModel >= 400 && eModel < VT_MAX) - { - // Get our Handling ID - eHandlingTypes eHandling = GetHandlingID(eModel); - // Return it - return m_pOriginalEntries[eHandling]; - } - - return NULL; + // Vehicle? + if (!IsVehicleModel(eModel)) + return nullptr; + + // Get our Handling ID, the default value will be HT_LANDSTAL + eHandlingTypes eHandling = GetHandlingID(eModel); + // Return it + return m_pOriginalEntries[eHandling]; } const CFlyingHandlingEntry* CHandlingManagerSA::GetOriginalFlyingHandlingData(eVehicleTypes eModel) { - // Within range? - if (eModel >= 400 && eModel < VT_MAX) - { - // Get our Handling ID - eHandlingTypes eHandling = GetHandlingID(eModel); - // Original GTA:SA behavior - if (eHandling < 186 || eHandling > 209) - return m_pOriginalFlyingEntries[0]; - else - return m_pOriginalFlyingEntries[eHandling - 186]; - } - - return NULL; + // Vehicle? + if (!IsVehicleModel(eModel)) + return nullptr; + + // Get our Handling ID, the default value will be HT_LANDSTAL + eHandlingTypes eHandling = GetHandlingID(eModel); + // Original GTA:SA behavior + if (eHandling < HT_SEAPLANE || eHandling > HT_RCRAIDER) + return m_pOriginalFlyingEntries[0]; + else + return m_pOriginalFlyingEntries[eHandling - HT_SEAPLANE]; } const CBoatHandlingEntry* CHandlingManagerSA::GetOriginalBoatHandlingData(eVehicleTypes eModel) { - // Within range? - if (eModel >= 400 && eModel < VT_MAX) - { - // Get our Handling ID - eHandlingTypes eHandling = GetHandlingID(eModel); - // Original GTA:SA behavior - if (eHandling < 175 || eHandling > 186) - return m_pOriginalBoatEntries[0]; - else - return m_pOriginalBoatEntries[eHandling - 175]; - } - - return NULL; + // Vehicle? + if (!IsVehicleModel(eModel)) + return nullptr; + + // Get our Handling ID, the default value will be HT_LANDSTAL + eHandlingTypes eHandling = GetHandlingID(eModel); + // Original GTA:SA behavior + if (eHandling < HT_PREDATOR || eHandling > HT_SEAPLANE) + return m_pOriginalBoatEntries[0]; + else + return m_pOriginalBoatEntries[eHandling - HT_PREDATOR]; } const CBikeHandlingEntry* CHandlingManagerSA::GetOriginalBikeHandlingData(eVehicleTypes eModel) { - // Within range? - if (eModel >= 400 && eModel < VT_MAX) - { - // Get our Handling ID - eHandlingTypes eHandling = GetHandlingID(eModel); - if (eHandling >= HT_BIKE && eHandling <= HT_FREEWAY) - return m_pOriginalBikeEntries[eHandling - HT_BIKE]; - else if (eHandling == HT_FAGGIO) - return m_pOriginalBikeEntries[13]; - } - - return NULL; + // Vehicle? + if (!IsVehicleModel(eModel)) + return nullptr; + + // Get our Handling ID, the default value will be HT_LANDSTAL + eHandlingTypes eHandling = GetHandlingID(eModel); + if (eHandling >= HT_BIKE && eHandling <= HT_FREEWAY) + return m_pOriginalBikeEntries[eHandling - HT_BIKE]; + else if (eHandling == HT_FAGGIO) + return m_pOriginalBikeEntries[13]; + else + return nullptr; } // Return the handling manager id @@ -9167,7 +9159,7 @@ void CHandlingManagerSA::CheckSuspensionChanges(CHandlingEntry* pEntry) CMultiplayer* pMultiplayer = g_pCore->GetMultiplayer(); eVehicleTypes eModel = pEntry->GetModel(); // Find our original data - const CHandlingEntry* pOriginal = m_pOriginalEntries[eModel]; + CHandlingEntrySA* pOriginal = m_pOriginalEntries[eModel]; // Default bChanged to false bool bChanged = false; @@ -9195,10 +9187,10 @@ void CHandlingManagerSA::CheckSuspensionChanges(CHandlingEntry* pEntry) bChanged = true; // Is bChanged true and the suspension flag changed marker false - if (bChanged == true && pEntry->HasSuspensionChanged() == false) + if (bChanged && !pEntry->HasSuspensionChanged()) { // Is our hook uninstalled? - if (pMultiplayer->IsSuspensionEnabled() == false) + if (!pMultiplayer->IsSuspensionEnabled()) // Install the hook pMultiplayer->SetSuspensionEnabled(true); @@ -9208,17 +9200,19 @@ void CHandlingManagerSA::CheckSuspensionChanges(CHandlingEntry* pEntry) pEntry->SetSuspensionChanged(true); } // is bChanged false and is this model supposed to contain non-default info? (i.e. they just reverted) - else if (bChanged == false && pEntry->HasSuspensionChanged() == true) + else if (!bChanged && pEntry->HasSuspensionChanged()) { // Decrement iChangedVehicles iChangedVehicles--; // Set the suspension Changed flag to false pEntry->SetSuspensionChanged(false); } + // if we hit 0 vehicles installed and it's installed uninstall the hook - if (iChangedVehicles == 0 && pMultiplayer->IsSuspensionEnabled() == true) + if (iChangedVehicles == 0 && pMultiplayer->IsSuspensionEnabled()) pMultiplayer->SetSuspensionEnabled(false); } + void CHandlingManagerSA::RemoveChangedVehicle() { // Decrement the count diff --git a/Client/game_sa/CHandlingManagerSA.h b/Client/game_sa/CHandlingManagerSA.h index 04f8f0dd0e..fe024b1041 100644 --- a/Client/game_sa/CHandlingManagerSA.h +++ b/Client/game_sa/CHandlingManagerSA.h @@ -1,11 +1,11 @@ /***************************************************************************** * - * PROJECT: Multi Theft Auto v1.0 + * PROJECT: Multi Theft Auto * LICENSE: See LICENSE in the top level directory - * FILE: game_sa/CHandlingManagerSA.h + * FILE: Client/game_sa/CHandlingManagerSA.h * PURPOSE: Header file for vehicle handling manager class * - * Multi Theft Auto is available from http://www.multitheftauto.com/ + * Multi Theft Auto is available from https://multitheftauto.com/ * *****************************************************************************/ @@ -35,7 +35,7 @@ class CHandlingManagerSA : public CHandlingManager eHandlingTypes GetHandlingID(eVehicleTypes eModel); - eHandlingProperty GetPropertyEnumFromName(std::string strName); + eHandlingProperty GetPropertyEnumFromName(const std::string& strName); void CheckSuspensionChanges(CHandlingEntry* pEntry); void RemoveChangedVehicle(); diff --git a/Client/game_sa/CPedSA.cpp b/Client/game_sa/CPedSA.cpp index 9cd8856e7a..009e618e8c 100644 --- a/Client/game_sa/CPedSA.cpp +++ b/Client/game_sa/CPedSA.cpp @@ -1108,3 +1108,34 @@ void CPedSA::StaticSetHooks() EZHookInstall(CPed_PreRenderAfterTest); EZHookInstall(CPed_PreRenderAfterTest_Mid); } + +void CPedSA::GetAttachedSatchels(std::vector& satchelsList) const +{ + // Array of projectiles objects + CProjectileSAInterface** projectilesArray = (CProjectileSAInterface**)ARRAY_CProjectile; + CProjectileSAInterface* pProjectileInterface; + + // Array of projectiles infos + CProjectileInfoSAInterface* projectilesInfoArray = (CProjectileInfoSAInterface*)ARRAY_CProjectileInfo; + CProjectileInfoSAInterface* pProjectileInfoInterface; + + // Loop through all projectiles + for (size_t i = 0; i < PROJECTILE_COUNT; i++) + { + pProjectileInterface = projectilesArray[i]; + + // is attached to our ped? + if (!pProjectileInterface || pProjectileInterface->m_pAttachedEntity != m_pInterface) + continue; + + // index is always the same for both arrays + pProjectileInfoInterface = &projectilesInfoArray[i]; + + // We are only interested in satchels + if (!pProjectileInfoInterface || pProjectileInfoInterface->dwProjectileType != eWeaponType::WEAPONTYPE_REMOTE_SATCHEL_CHARGE) + continue; + + // Push satchel into the array. There is no need to check the counter because for satchels it restarts until the player detonates the charges + satchelsList.push_back({pProjectileInterface, &pProjectileInterface->m_vecAttachedOffset, &pProjectileInterface->m_vecAttachedRotation}); + } +} diff --git a/Client/game_sa/CPedSA.h b/Client/game_sa/CPedSA.h index 5d7c8044ed..daae468472 100644 --- a/Client/game_sa/CPedSA.h +++ b/Client/game_sa/CPedSA.h @@ -408,4 +408,6 @@ class CPedSA : public virtual CPed, public virtual CPhysicalSA void* GetPedNodeInterface(std::int32_t nodeId) { return reinterpret_cast(m_pInterface)->pedNodes[nodeId]; } std::unique_ptr GetPedIK() { return std::make_unique(GetPedIKInterface()); } static void StaticSetHooks(); + + void GetAttachedSatchels(std::vector &satchelsList) const override; }; diff --git a/Client/game_sa/CTasksSA.cpp b/Client/game_sa/CTasksSA.cpp index bd92d51358..9c080e5835 100644 --- a/Client/game_sa/CTasksSA.cpp +++ b/Client/game_sa/CTasksSA.cpp @@ -1,11 +1,11 @@ /***************************************************************************** * - * PROJECT: Multi Theft Auto v1.0 + * PROJECT: Multi Theft Auto * LICENSE: See LICENSE in the top level directory - * FILE: game_sa/CTasksSA.cpp + * FILE: Client/game_sa/CTasksSA.cpp * PURPOSE: Task creation * - * Multi Theft Auto is available from http://www.multitheftauto.com/ + * Multi Theft Auto is available from https://multitheftauto.com/ * *****************************************************************************/ @@ -23,6 +23,7 @@ #include "TaskPhysicalResponseSA.h" #include "TaskSA.h" #include "TaskSecondarySA.h" +#include "CAnimManagerSA.h" extern CGameSA* pGame; @@ -141,6 +142,9 @@ CTaskSimpleJetPack* CTasksSA::CreateTaskSimpleJetpack(const CVector* pVecTargetP CTaskSimpleRunAnim* CTasksSA::CreateTaskSimpleRunAnim(const AssocGroupId animGroup, const AnimationId animID, const float fBlendDelta, const int iTaskType, const char* pTaskName, const bool bHoldLastFrame) { + if (!pGame->GetAnimManager()->IsValidAnim(animGroup, animID)) + return nullptr; + CTaskSimpleRunAnimSA* pTask = NewTask(animGroup, animID, fBlendDelta, iTaskType, pTaskName, bHoldLastFrame); m_pTaskManagementSystem->AddTask(pTask); return pTask; @@ -160,6 +164,9 @@ CTaskComplexDie* CTasksSA::CreateTaskComplexDie(const eWeaponType eMeansOfDeath, const float fAnimSpeed, const bool bBeingKilledByStealth, const bool bFallingToDeath, const int iFallToDeathDir, const bool bFallToDeathOverRailing) { + if (!pGame->GetAnimManager()->IsValidAnim(animGroup, anim)) + return nullptr; + CTaskComplexDieSA* pTask = NewTask(eMeansOfDeath, animGroup, anim, fBlendDelta, fAnimSpeed, bBeingKilledByStealth, bFallingToDeath, iFallToDeathDir, bFallToDeathOverRailing); m_pTaskManagementSystem->AddTask(pTask); @@ -168,6 +175,9 @@ CTaskComplexDie* CTasksSA::CreateTaskComplexDie(const eWeaponType eMeansOfDeath, CTaskSimpleStealthKill* CTasksSA::CreateTaskSimpleStealthKill(bool bKiller, class CPed* pPed, const AnimationId animGroup) { + if (!pGame->GetAnimManager()->IsValidGroup(animGroup)) + return nullptr; + CTaskSimpleStealthKillSA* pTask = NewTask(bKiller, pPed, animGroup); m_pTaskManagementSystem->AddTask(pTask); return pTask; diff --git a/Client/game_sa/CVehicleSA.cpp b/Client/game_sa/CVehicleSA.cpp index 7bfaa5fb7b..c2c612d5c7 100644 --- a/Client/game_sa/CVehicleSA.cpp +++ b/Client/game_sa/CVehicleSA.cpp @@ -11,6 +11,7 @@ #include "StdInc.h" #include "CAutomobileSA.h" +#include "CBikeSA.h" #include "CCameraSA.h" #include "CColModelSA.h" #include "CFxManagerSA.h" @@ -494,6 +495,37 @@ void CVehicleSA::SetPlaneRotorSpeed(float fSpeed) pInterface->m_fPropSpeed = fSpeed; } +bool CVehicleSA::SetVehicleWheelRotation(float fWheelRot1, float fWheelRot2, float fWheelRot3, float fWheelRot4) noexcept +{ + VehicleClass m_eVehicleType = static_cast(GetVehicleInterface()->m_vehicleSubClass); + switch (m_eVehicleType) + { + case VehicleClass::AUTOMOBILE: + case VehicleClass::MONSTER_TRUCK: + case VehicleClass::QUAD: + case VehicleClass::TRAILER: + { + auto pInterface = static_cast(GetInterface()); + pInterface->m_wheelRotation[0] = fWheelRot1; + pInterface->m_wheelRotation[1] = fWheelRot2; + pInterface->m_wheelRotation[2] = fWheelRot3; + pInterface->m_wheelRotation[3] = fWheelRot4; + return true; + } + case VehicleClass::BIKE: + case VehicleClass::BMX: + { + auto pInterface = static_cast(GetInterface()); + pInterface->m_afWheelRotationX[0] = fWheelRot1; + pInterface->m_afWheelRotationX[1] = fWheelRot2; + return true; + } + default: + return false; + } + return false; +} + float CVehicleSA::GetPlaneRotorSpeed() { auto pInterface = static_cast(GetInterface()); diff --git a/Client/game_sa/CVehicleSA.h b/Client/game_sa/CVehicleSA.h index cd8ddb9179..f9847d4c33 100644 --- a/Client/game_sa/CVehicleSA.h +++ b/Client/game_sa/CVehicleSA.h @@ -568,6 +568,7 @@ class CVehicleSA : public virtual CVehicle, public virtual CPhysicalSA }; void SetHeliRotorSpeed(float fSpeed) { *reinterpret_cast(reinterpret_cast(m_pInterface) + 2124) = fSpeed; }; void SetPlaneRotorSpeed(float fSpeed); + bool SetVehicleWheelRotation(float fWheelRot1, float fWheelRot2, float fWheelRot3, float fWheelRot4) noexcept; void SetExplodeTime(unsigned long ulTime) { *reinterpret_cast(reinterpret_cast(m_pInterface) + 1240) = ulTime; }; void SetRadioStatus(bool bStatus) { *reinterpret_cast(reinterpret_cast(m_pInterface) + 0x1D3) = bStatus; }; diff --git a/Client/game_sa/CWeatherSA.cpp b/Client/game_sa/CWeatherSA.cpp index 7fdb856bfb..c549aa08e1 100644 --- a/Client/game_sa/CWeatherSA.cpp +++ b/Client/game_sa/CWeatherSA.cpp @@ -62,3 +62,169 @@ void CWeatherSA::ResetAmountOfRain() MemCpy((LPVOID)0x72BC92, &originalFstp1, 6); MemCpy((LPVOID)0x72C686, &originalFstp2, 6); } + +float CWeatherSA::GetWetRoads() const +{ + return *(float*)0xC81308; +} + +bool CWeatherSA::SetWetRoads(float fAmount) +{ + MemSet((LPVOID)(0x72BB9F + 2), 0x90, 3); + MemSet((LPVOID)(0x72BBB7 + 2), 0x90, 3); + MemSet((LPVOID)(0x72BBD0 + 1), 0x90, 3); + MemSet((LPVOID)(0x72BBD7 + 2), 0x90, 3); + + MemPutFast(0xC81308, fAmount); + return true; +} + +bool CWeatherSA::ResetWetRoads() +{ + BYTE originalCodes[3] = {0x08, 0x13, 0xC8}; + MemCpy((LPVOID)(0x72BB9F + 2), &originalCodes, 3); + MemCpy((LPVOID)(0x72BBB7 + 2), &originalCodes, 3); + MemCpy((LPVOID)(0x72BBD0 + 1), &originalCodes, 3); + MemCpy((LPVOID)(0x72BBD7 + 2), &originalCodes, 3); + return true; +} + +float CWeatherSA::GetFoggyness() const +{ + return *(float*)0xC81300; +} + +bool CWeatherSA::SetFoggyness(float fAmount) +{ + MemSet((LPVOID)(0x72BDF5 + 2), 0x90, 3); + MemSet((LPVOID)(0x72BDDD + 2), 0x90, 3); + MemSet((LPVOID)(0x72BE13 + 2), 0x90, 3); + + MemPutFast(0xC81300, fAmount); + return true; +} + +bool CWeatherSA::ResetFoggyness() +{ + BYTE originalCodes[3] = {0x00, 0x13, 0xC8}; + MemCpy((LPVOID)(0x72BDF5 + 2), &originalCodes, 3); + MemCpy((LPVOID)(0x72BDDD + 2), &originalCodes, 3); + MemCpy((LPVOID)(0x72BE13 + 2), &originalCodes, 3); + return true; +} + +float CWeatherSA::GetFog() const +{ + return *(float*)0xC812FC; +} + +bool CWeatherSA::SetFog(float fAmount) +{ + MemSet((LPVOID)(0x72BE37 + 2), 0x90, 3); + MemSet((LPVOID)(0x72BE1F + 2), 0x90, 3); + MemSet((LPVOID)(0x72BE4F + 2), 0x90, 3); + + MemPutFast(0xC812FC, fAmount); + return true; +} + +bool CWeatherSA::ResetFog() +{ + BYTE originalCodes[3] = {0xFC, 0x12, 0xC8}; + MemCpy((LPVOID)(0x72BE37 + 2), &originalCodes, 3); + MemCpy((LPVOID)(0x72BE1F + 2), &originalCodes, 3); + MemCpy((LPVOID)(0x72BE4F + 2), &originalCodes, 3); + return true; +} + +float CWeatherSA::GetRainFog() const +{ + return *(float*)0xC81410; +} + +bool CWeatherSA::SetRainFog(float fAmount) +{ + MemSet((LPVOID)(0x72ADD8 + 2), 0x90, 3); + MemSet((LPVOID)(0x72ADE4 + 2), 0x90, 3); + + MemPutFast(0xC81410, fAmount); + return true; +} + +bool CWeatherSA::ResetRainFog() +{ + BYTE originalCodes[3] = {0x10, 0x14, 0xC8}; + MemCpy((LPVOID)(0x72ADD8 + 2), &originalCodes, 3); + MemCpy((LPVOID)(0x72ADE4 + 2), &originalCodes, 3); + return true; +} + +float CWeatherSA::GetWaterFog() const +{ + return *(float*)0xC81338; +} + +bool CWeatherSA::SetWaterFog(float fAmount) +{ + MemSet((LPVOID)(0x72C35C + 2), 0x90, 3); + MemSet((LPVOID)(0x72C38E + 2), 0x90, 3); + MemSet((LPVOID)(0x72C36F + 2), 0x90, 3); + + MemPutFast(0xC81338, fAmount); + return true; +} + +bool CWeatherSA::ResetWaterFog() +{ + BYTE originalCodes[3] = {0x38, 0x13, 0xC8}; + MemCpy((LPVOID)(0x72C35C + 2), &originalCodes, 3); + MemCpy((LPVOID)(0x72C38E + 2), &originalCodes, 3); + MemCpy((LPVOID)(0x72C36F + 2), &originalCodes, 3); + return true; +} + +float CWeatherSA::GetSandstorm() const +{ + return *(float*)0xC812F4; +} + +bool CWeatherSA::SetSandstorm(float fAmount) +{ + MemSet((LPVOID)(0x72A4B6 + 1), 0x90, 3); + MemSet((LPVOID)(0x72BCEB + 1), 0x90, 3); + MemSet((LPVOID)(0x72BD0B + 2), 0x90, 3); + + MemPutFast(0xC812F4, fAmount); + return true; +} + +bool CWeatherSA::ResetSandstorm() +{ + BYTE originalCodes[3] = {0xF4, 0x12, 0xC8}; + MemCpy((LPVOID)(0x72A4B6 + 1), &originalCodes, 3); + MemCpy((LPVOID)(0x72BCEB + 1), &originalCodes, 3); + MemCpy((LPVOID)(0x72BD0B + 2), &originalCodes, 3); + return true; +} + +float CWeatherSA::GetRainbow() const +{ + return *(float*)0xC812E4; +} + +bool CWeatherSA::SetRainbow(float fAmount) +{ + MemSet((LPVOID)(0x72BF51 + 2), 0x90, 3); + MemSet((LPVOID)(0x72BF59 + 2), 0x90, 3); + + MemPutFast(0xC812E4, fAmount); + return true; +} + +bool CWeatherSA::ResetRainbow() +{ + BYTE originalCodes[3] = {0xE4, 0x12, 0xC8}; + MemCpy((LPVOID)(0x72BF51 + 2), &originalCodes, 3); + MemCpy((LPVOID)(0x72BF59 + 2), &originalCodes, 3); + return true; +} diff --git a/Client/game_sa/CWeatherSA.h b/Client/game_sa/CWeatherSA.h index 32e501166c..8e6d970d1d 100644 --- a/Client/game_sa/CWeatherSA.h +++ b/Client/game_sa/CWeatherSA.h @@ -26,4 +26,39 @@ class CWeatherSA : public CWeather float GetAmountOfRain(); void SetAmountOfRain(float fAmount); void ResetAmountOfRain(); + + float GetWetRoads() const; + bool SetWetRoads(float fAmount); + bool ResetWetRoads(); + + float GetFoggyness() const; + bool SetFoggyness(float fAmount); + bool ResetFoggyness(); + + float GetFog() const; + bool SetFog(float fAmount); + bool ResetFog(); + + float GetRainFog() const; + bool SetRainFog(float fAmount); + bool ResetRainFog(); + + float GetWaterFog() const; + bool SetWaterFog(float fAmount); + bool ResetWaterFog(); + + float GetSandstorm() const; + bool SetSandstorm(float fAmount); + bool ResetSandstorm(); + + float GetRainbow() const; + bool SetRainbow(float fAmount); + bool ResetRainbow(); + +private: + static unsigned char* VAR_CWeather__ForcedWeatherType; + static unsigned char* VAR_CWeather__OldWeatherType; + static unsigned char* VAR_CWeather__NewWeatherType; + static float* VAR_CWeather__Rain; + }; diff --git a/Client/loader/CInstallManager.cpp b/Client/loader/CInstallManager.cpp index c16c3afcec..0f1b9f9728 100644 --- a/Client/loader/CInstallManager.cpp +++ b/Client/loader/CInstallManager.cpp @@ -1147,7 +1147,7 @@ SString CInstallManager::_ProcessServiceChecks() { if (!CheckService(CHECK_SERVICE_PRE_GAME)) { - if (!IsUserAdmin()) + if (!IsNativeArm64Host() && !IsUserAdmin()) { m_strAdminReason = _("Update install settings"); return "fail"; @@ -1269,17 +1269,31 @@ SString CInstallManager::_ProcessAppCompatChecks() } // Windows 7: Fix invalid GameUX URL (which causes rundll32.exe to use excessive CPU) - WString strUrlKey = L"SOFTWARE\\Classes\\Local Settings\\Software\\Microsoft\\Windows\\GameUX\\ServiceLocation"; - WString strUrlItem = L"Games"; - WString strUrlValue = ReadCompatibilityEntries(strUrlItem, strUrlKey, HKEY_CURRENT_USER, 0); - if (!strUrlValue.empty()) { - WriteDebugEvent(SString("GameUX ServiceLocation was '%s'", *ToUTF8(strUrlValue))); - if (strUrlValue.ContainsI(L":")) + WString strUrlKey = L"SOFTWARE\\Classes\\Local Settings\\Software\\Microsoft\\Windows\\GameUX\\ServiceLocation"; + WString strUrlItem = L"Games"; + WString strUrlValue = ReadCompatibilityEntries(strUrlItem, strUrlKey, HKEY_CURRENT_USER, 0); + if (!strUrlValue.empty()) { - strUrlValue = L"disabled"; // Can be anything not containing `:` - if (!WriteCompatibilityEntries(strUrlItem, strUrlKey, HKEY_CURRENT_USER, 0, strUrlValue)) - bTryAdmin = true; + WriteDebugEvent(SString("GameUX ServiceLocation was '%s'", *ToUTF8(strUrlValue))); + if (strUrlValue.ContainsI(L":")) + { + strUrlValue = L"disabled"; // Can be anything not containing `:` + if (!WriteCompatibilityEntries(strUrlItem, strUrlKey, HKEY_CURRENT_USER, 0, strUrlValue)) + bTryAdmin = true; + } + } + } + + // Windows 10: Disable multi-threaded loading of DLLs. + { + DWORD maxLoaderThreads{}; + LPCWSTR imageFileExecutionOptions = L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Image File Execution Options\\" GTA_EXE_NAME; + RegQueryInteger(HKEY_LOCAL_MACHINE, imageFileExecutionOptions, L"MaxLoaderThreads", maxLoaderThreads); + + if (maxLoaderThreads != 1 && !RegWriteInteger(HKEY_LOCAL_MACHINE, imageFileExecutionOptions, L"MaxLoaderThreads", 1)) + { + bTryAdmin = true; } } diff --git a/Client/loader/Utils.cpp b/Client/loader/Utils.cpp index db8cde4125..9d3ead9eba 100644 --- a/Client/loader/Utils.cpp +++ b/Client/loader/Utils.cpp @@ -2178,6 +2178,32 @@ bool IsNativeArm64Host() return isArm64; } +bool RegQueryInteger(HKEY rootKey, LPCWSTR keyName, LPCWSTR valueName, DWORD& value) +{ + value = {}; + + HKEY key{}; + if (RegOpenKeyExW(rootKey, keyName, 0, KEY_READ, &key) != ERROR_SUCCESS) + return false; + + DWORD valueType = REG_DWORD; + DWORD valueSize = sizeof(value); + LSTATUS status = RegQueryValueExW(key, valueName, nullptr, &valueType, reinterpret_cast(&value), &valueSize); + RegCloseKey(key); + return status == ERROR_SUCCESS; +} + +bool RegWriteInteger(HKEY rootKey, LPCWSTR keyName, LPCWSTR valueName, DWORD value) +{ + HKEY key{}; + if (RegCreateKeyExW(rootKey, keyName, 0, 0, REG_OPTION_NON_VOLATILE, KEY_WRITE, nullptr, &key, nullptr) != ERROR_SUCCESS) + return false; + + LSTATUS status = RegSetValueExW(key, valueName, 0, REG_DWORD, reinterpret_cast(&value), sizeof(value)); + RegCloseKey(key); + return status == ERROR_SUCCESS; +} + ////////////////////////////////////////////////////////// // // ReadCompatibilityEntries diff --git a/Client/loader/Utils.h b/Client/loader/Utils.h index ab7530f4f2..be0685a83c 100644 --- a/Client/loader/Utils.h +++ b/Client/loader/Utils.h @@ -156,6 +156,16 @@ bool IsErrorCodeLoggable(const std::error_code& ec); */ bool IsNativeArm64Host(); +/** + * @brief Queries the integer value of a specific value item from the registry. + */ +bool RegQueryInteger(HKEY rootKey, LPCWSTR keyName, LPCWSTR valueName, DWORD& value); + +/** + * @brief Writes an integer value to a specific value item in the registry. + */ +bool RegWriteInteger(HKEY rootKey, LPCWSTR keyName, LPCWSTR valueName, DWORD value); + // Return false on read failure template bool ReadFileValue(const SString& strFilename, T& value, uint uiOffset) diff --git a/Client/mods/deathmatch/logic/CClient3DMarker.cpp b/Client/mods/deathmatch/logic/CClient3DMarker.cpp index 5f04bc5fe7..03a862c4b9 100644 --- a/Client/mods/deathmatch/logic/CClient3DMarker.cpp +++ b/Client/mods/deathmatch/logic/CClient3DMarker.cpp @@ -102,3 +102,11 @@ void CClient3DMarker::DoPulse() } } } + +void CClient3DMarker::SetColor(const SColor& color) noexcept +{ + m_Color = color; + + if (!m_ignoreAlphaLimits && m_dwType == MARKER3D_ARROW) + m_Color.A = 255; +} diff --git a/Client/mods/deathmatch/logic/CClient3DMarker.h b/Client/mods/deathmatch/logic/CClient3DMarker.h index 194b15b191..945bb25b2f 100644 --- a/Client/mods/deathmatch/logic/CClient3DMarker.h +++ b/Client/mods/deathmatch/logic/CClient3DMarker.h @@ -45,7 +45,7 @@ class CClient3DMarker : public CClientMarkerCommon void SetVisible(bool bVisible) { m_bVisible = bVisible; }; SColor GetColor() const { return m_Color; } - void SetColor(const SColor& color) { m_Color = color; } + void SetColor(const SColor& color) noexcept; float GetSize() const { return m_fSize; }; void SetSize(float fSize) { m_fSize = fSize; }; @@ -53,6 +53,9 @@ class CClient3DMarker : public CClientMarkerCommon float GetPulseFraction() { return static_cast(m_pMarker->GetPulseFraction()); }; void SetPulseFraction(float fFraction) { m_pMarker->SetPulseFraction(fFraction); }; + void SetIgnoreAlphaLimits(bool ignore) noexcept { m_ignoreAlphaLimits = ignore; }; + bool AreAlphaLimitsIgnored() const noexcept override { return m_ignoreAlphaLimits; }; + protected: void StreamIn(); void StreamOut(); @@ -70,4 +73,5 @@ class CClient3DMarker : public CClientMarkerCommon C3DMarker* m_pMarker; unsigned int m_ulIdentifier; bool m_bMarkerStreamedIn; + bool m_ignoreAlphaLimits; }; diff --git a/Client/mods/deathmatch/logic/CClientCheckpoint.cpp b/Client/mods/deathmatch/logic/CClientCheckpoint.cpp index 4ab0a9bdc9..fbd7fa8f8e 100644 --- a/Client/mods/deathmatch/logic/CClientCheckpoint.cpp +++ b/Client/mods/deathmatch/logic/CClientCheckpoint.cpp @@ -22,11 +22,14 @@ CClientCheckpoint::CClientCheckpoint(CClientMarker* pThis) m_bStreamedIn = false; m_bVisible = true; m_uiIcon = CClientCheckpoint::ICON_NONE; - m_Color = SColorRGBA(255, 0, 0, 255); + m_Color = SColorRGBA(255, 0, 0, 128); m_fSize = 4.0f; m_dwType = CHECKPOINT_EMPTYTUBE; m_vecDirection.fX = 1.0f; m_bHasTarget = false; + m_ignoreAlphaLimits = false; + m_TargetArrowColor = SColorRGBA(255, 64, 64, 255); + m_TargetArrowSize = m_fSize * 0.625f; } CClientCheckpoint::~CClientCheckpoint() @@ -248,8 +251,14 @@ void CClientCheckpoint::SetColor(const SColor& color) // Different from our current color? if (m_Color != color) { - // Set it and recreate + // Set it m_Color = color; + + // Default alpha + if (!m_ignoreAlphaLimits && GetCheckpointType() == CClientCheckpoint::TYPE_NORMAL) + m_Color.A = 128; + + // Recreate ReCreate(); } } @@ -261,6 +270,8 @@ void CClientCheckpoint::SetSize(float fSize) { // Set the new size and recreate m_fSize = fSize; + m_TargetArrowSize = fSize * 0.625f; + ReCreate(); } } @@ -352,6 +363,7 @@ void CClientCheckpoint::Create(unsigned long ulIdentifier) { // Set properties m_pCheckpoint->SetRotateRate(0); + ApplyCheckpointTargetArrowProperties(); } } } @@ -385,3 +397,20 @@ void CClientCheckpoint::ReCreateWithSameIdentifier() Create(m_dwIdentifier); } } + +void CClientCheckpoint::SetTargetArrowProperties(const SColor& arrowColor, float size) noexcept +{ + if (m_TargetArrowColor == arrowColor && m_TargetArrowSize == size) + return; + + m_TargetArrowColor = arrowColor; + m_TargetArrowSize = size; + + ApplyCheckpointTargetArrowProperties(); +} + +void CClientCheckpoint::ApplyCheckpointTargetArrowProperties() noexcept +{ + if (m_pCheckpoint && m_uiIcon == CClientCheckpoint::ICON_ARROW) + m_pCheckpoint->SetTargetArrowData(m_TargetArrowColor, m_TargetArrowSize); +} diff --git a/Client/mods/deathmatch/logic/CClientCheckpoint.h b/Client/mods/deathmatch/logic/CClientCheckpoint.h index adafcdf39d..ec99bbfd34 100644 --- a/Client/mods/deathmatch/logic/CClientCheckpoint.h +++ b/Client/mods/deathmatch/logic/CClientCheckpoint.h @@ -74,6 +74,13 @@ class CClientCheckpoint : public CClientMarkerCommon static bool IconToString(unsigned char ucIcon, SString& strOutString); void ReCreateWithSameIdentifier(); + void SetIgnoreAlphaLimits(bool ignore) noexcept { m_ignoreAlphaLimits = ignore; }; + bool AreAlphaLimitsIgnored() const noexcept override { return m_ignoreAlphaLimits; }; + + SColor GetTargetArrowColor() const noexcept { return m_TargetArrowColor; }; + float GetTargetArrowSize() const noexcept { return m_TargetArrowSize; }; + void SetTargetArrowProperties(const SColor& arrowColor, float size) noexcept; + protected: bool IsStreamedIn() { return m_bStreamedIn; }; void StreamIn(); @@ -83,6 +90,7 @@ class CClientCheckpoint : public CClientMarkerCommon void Create(unsigned long ulIdentifier = 0); void Destroy(); void ReCreate(); + void ApplyCheckpointTargetArrowProperties() noexcept; CClientMarkerPtr m_pThis; bool m_bStreamedIn; @@ -95,6 +103,9 @@ class CClientCheckpoint : public CClientMarkerCommon float m_fSize; SColor m_Color; CCheckpoint* m_pCheckpoint; + bool m_ignoreAlphaLimits; + SColor m_TargetArrowColor; + float m_TargetArrowSize; DWORD m_dwIdentifier; bool m_bHasTarget; diff --git a/Client/mods/deathmatch/logic/CClientCorona.h b/Client/mods/deathmatch/logic/CClientCorona.h index ed1977cadb..53f312e60d 100644 --- a/Client/mods/deathmatch/logic/CClientCorona.h +++ b/Client/mods/deathmatch/logic/CClientCorona.h @@ -41,6 +41,9 @@ class CClientCorona : public CClientMarkerCommon void SetReflectionEnabled(bool bEnabled) { m_bReflectionEnabled = bEnabled; }; bool IsReflectionEnabled() const { return m_bReflectionEnabled; }; + void SetIgnoreAlphaLimits(bool ignore) noexcept {}; + bool AreAlphaLimitsIgnored() const noexcept override { return true; }; + protected: bool IsStreamedIn() { return m_bStreamedIn; }; void StreamIn(); diff --git a/Client/mods/deathmatch/logic/CClientGame.cpp b/Client/mods/deathmatch/logic/CClientGame.cpp index 41c5cd4e3e..5aee699475 100644 --- a/Client/mods/deathmatch/logic/CClientGame.cpp +++ b/Client/mods/deathmatch/logic/CClientGame.cpp @@ -2638,7 +2638,7 @@ void CClientGame::AddBuiltInEvents() m_Events.AddEvent("onClientPlayerRadioSwitch", "", NULL, false); m_Events.AddEvent("onClientPlayerDamage", "attacker, weapon, bodypart", NULL, false); m_Events.AddEvent("onClientPlayerWeaponFire", "weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement", NULL, false); - m_Events.AddEvent("onClientPlayerWasted", "", NULL, false); + m_Events.AddEvent("onClientPlayerWasted", "ammo, killer, weapon, bodypart, isStealth, animGroup, animID", nullptr, false); m_Events.AddEvent("onClientPlayerChoke", "", NULL, false); m_Events.AddEvent("onClientPlayerVoiceStart", "", NULL, false); m_Events.AddEvent("onClientPlayerVoiceStop", "", NULL, false); @@ -5522,6 +5522,28 @@ void CClientGame::ResetMapInfo() // Moon size g_pMultiplayer->ResetMoonSize(); + // World properties + g_pMultiplayer->ResetAmbientColor(); + g_pMultiplayer->ResetAmbientObjectColor(); + g_pMultiplayer->ResetDirectionalColor(); + g_pMultiplayer->ResetSpriteSize(); + g_pMultiplayer->ResetSpriteBrightness(); + g_pMultiplayer->ResetPoleShadowStrength(); + g_pMultiplayer->ResetShadowStrength(); + g_pMultiplayer->ResetShadowsOffset(); + g_pMultiplayer->ResetLightsOnGroundBrightness(); + g_pMultiplayer->ResetLowCloudsColor(); + g_pMultiplayer->ResetBottomCloudsColor(); + g_pMultiplayer->ResetCloudsAlpha1(); + g_pMultiplayer->ResetIllumination(); + g_pGame->GetWeather()->ResetWetRoads(); + g_pGame->GetWeather()->ResetFoggyness(); + g_pGame->GetWeather()->ResetFog(); + g_pGame->GetWeather()->ResetRainFog(); + g_pGame->GetWeather()->ResetWaterFog(); + g_pGame->GetWeather()->ResetSandstorm(); + g_pGame->GetWeather()->ResetRainbow(); + // Disable the change of any player stats g_pMultiplayer->SetLocalStatsStatic(true); @@ -5643,6 +5665,8 @@ void CClientGame::DoWastedCheck(ElementID damagerID, unsigned char ucWeapon, uns else Arguments.PushBoolean(false); Arguments.PushBoolean(false); + Arguments.PushNumber(animGroup); + Arguments.PushNumber(animID); m_pLocalPlayer->CallEvent("onClientPlayerWasted", Arguments, true); // Write some death info @@ -6086,6 +6110,9 @@ bool CClientGame::SetWorldSpecialProperty(WorldSpecialProperty property, bool is case WorldSpecialProperty::ROADSIGNSTEXT: g_pGame->SetRoadSignsTextEnabled(isEnabled); return true; + case WorldSpecialProperty::TUNNELWEATHERBLEND: + g_pGame->SetTunnelWeatherBlendEnabled(isEnabled); + return true; } return false; } @@ -6121,6 +6148,8 @@ bool CClientGame::IsWorldSpecialProperty(WorldSpecialProperty property) return g_pGame->IsExtendedWaterCannonsEnabled(); case WorldSpecialProperty::ROADSIGNSTEXT: return g_pGame->IsRoadSignsTextEnabled(); + case WorldSpecialProperty::TUNNELWEATHERBLEND: + return g_pGame->IsTunnelWeatherBlendEnabled(); } return false; } diff --git a/Client/mods/deathmatch/logic/CClientIMGManager.cpp b/Client/mods/deathmatch/logic/CClientIMGManager.cpp index ea85f045d5..6a8c6e7e6d 100644 --- a/Client/mods/deathmatch/logic/CClientIMGManager.cpp +++ b/Client/mods/deathmatch/logic/CClientIMGManager.cpp @@ -129,7 +129,8 @@ void CClientIMGManager::UpdateStreamerBufferSize() m_LargestFileSizeBlocks = CalculateLargestFile(); // Only update if necessary, otherwise leave it be [User might've set it manually - we don't want to touch that] - if (const auto s = g_pGame->GetStreaming(); m_LargestFileSizeBlocks > s->GetStreamingBufferSize()) { + if (const auto s = g_pGame->GetStreaming(); m_LargestFileSizeBlocks * 2048 > s->GetStreamingBufferSize()) + { s->SetStreamingBufferSize(m_LargestFileSizeBlocks); } } diff --git a/Client/mods/deathmatch/logic/CClientMarker.cpp b/Client/mods/deathmatch/logic/CClientMarker.cpp index d193ab1823..b01a3ade2c 100644 --- a/Client/mods/deathmatch/logic/CClientMarker.cpp +++ b/Client/mods/deathmatch/logic/CClientMarker.cpp @@ -510,3 +510,8 @@ CSphere CClientMarker::GetWorldBoundingSphere() sphere.fRadius = GetSize(); return sphere; } + +void CClientMarker::SetIgnoreAlphaLimits(bool ignore) +{ + m_pMarker->SetIgnoreAlphaLimits(ignore); +} diff --git a/Client/mods/deathmatch/logic/CClientMarker.h b/Client/mods/deathmatch/logic/CClientMarker.h index 2cffa3b97b..4aee90b93d 100644 --- a/Client/mods/deathmatch/logic/CClientMarker.h +++ b/Client/mods/deathmatch/logic/CClientMarker.h @@ -84,6 +84,9 @@ class CClientMarker final : public CClientStreamElement, private CClientColCallb virtual CSphere GetWorldBoundingSphere(); + void SetIgnoreAlphaLimits(bool ignore); + bool AreAlphaLimitsIgnored() const noexcept { return m_pMarker->AreAlphaLimitsIgnored(); }; + protected: void StreamIn(bool bInstantly); void StreamOut(); diff --git a/Client/mods/deathmatch/logic/CClientMarkerCommon.h b/Client/mods/deathmatch/logic/CClientMarkerCommon.h index 3f7e101a8a..02ed426f69 100644 --- a/Client/mods/deathmatch/logic/CClientMarkerCommon.h +++ b/Client/mods/deathmatch/logic/CClientMarkerCommon.h @@ -56,4 +56,7 @@ class CClientMarkerCommon virtual void StreamIn() = 0; virtual void StreamOut() = 0; + + virtual void SetIgnoreAlphaLimits(bool ignore) noexcept = 0; + virtual bool AreAlphaLimitsIgnored() const noexcept = 0; }; diff --git a/Client/mods/deathmatch/logic/CClientPed.cpp b/Client/mods/deathmatch/logic/CClientPed.cpp index 7fee88ce63..81faab7efd 100644 --- a/Client/mods/deathmatch/logic/CClientPed.cpp +++ b/Client/mods/deathmatch/logic/CClientPed.cpp @@ -1761,6 +1761,11 @@ void CClientPed::InternalSetHealth(float fHealth) } else { + // Ped is alive again (Fix #414) + UnlockHealth(); + UnlockArmor(); + SetIsDead(false); + // Recreate the player ReCreateModel(); } @@ -3868,6 +3873,10 @@ void CClientPed::_ChangeModel() SetStat(23, 0.0f); } + // Store attached satchels + std::vector attachedSatchels; + m_pPlayerPed->GetAttachedSatchels(attachedSatchels); + if (m_bIsLocalPlayer) { // TODO: Create a simple function to save and restore player states and use it @@ -3982,6 +3991,19 @@ void CClientPed::_ChangeModel() _CreateModel(); } + // ReAttach satchels + CClientProjectileManager* pProjectileManager = m_pManager->GetProjectileManager(); + + for (const SSatchelsData& satchelData : attachedSatchels) + { + CClientProjectile* pSatchel = pProjectileManager->Get((CEntitySAInterface*)satchelData.pProjectileInterface); + if (!pSatchel || pSatchel->IsBeingDeleted()) + continue; + + pSatchel->SetAttachedOffsets(*satchelData.vecAttachedOffsets, *satchelData.vecAttachedRotation); + pSatchel->InternalAttachTo(this); + } + g_pMultiplayer->SetAutomaticVehicleStartupOnPedEnter(true); } if (m_clientModel && m_clientModel->GetModelID() != m_ulModel) @@ -5205,6 +5227,8 @@ void CClientPed::Respawn(CVector* pvecPosition, bool bRestoreState, bool bCamera float fTargetRotation = m_pPlayerPed->GetTargetRotation(); unsigned char ucInterior = GetInterior(); unsigned char ucCameraInterior = static_cast(g_pGame->GetWorld()->GetCurrentArea()); + bool bOldNightVision = g_pMultiplayer->IsNightVisionEnabled(); + bool bOldThermalVision = g_pMultiplayer->IsThermalVisionEnabled(); // Don't allow any camera movement if we're in fixed mode if (m_pManager->GetCamera()->IsInFixedMode()) @@ -5215,6 +5239,9 @@ void CClientPed::Respawn(CVector* pvecPosition, bool bRestoreState, bool bCamera m_pPlayerPed->SetLanding(false); + // Set it to 0 (Fix #501) + SetCurrentWeaponSlot(eWeaponSlot::WEAPONSLOT_TYPE_UNARMED); + if (bRestoreState) { // Jax: restore all the things we saved @@ -5230,6 +5257,10 @@ void CClientPed::Respawn(CVector* pvecPosition, bool bRestoreState, bool bCamera // Restore the camera's interior whether we're restoring player states or not g_pGame->GetWorld()->SetCurrentArea(ucCameraInterior); + // Reset goggle effect + g_pMultiplayer->SetNightVisionEnabled(bOldNightVision, false); + g_pMultiplayer->SetThermalVisionEnabled(bOldThermalVision, false); + // Reattach us if (pAttachedTo && pAttachedTo->IsEntityAttached(this)) InternalAttachTo(pAttachedTo); diff --git a/Client/mods/deathmatch/logic/CClientPlayer.h b/Client/mods/deathmatch/logic/CClientPlayer.h index 15327790e0..bef1f26497 100644 --- a/Client/mods/deathmatch/logic/CClientPlayer.h +++ b/Client/mods/deathmatch/logic/CClientPlayer.h @@ -111,6 +111,9 @@ class CClientPlayer final : public CClientPed bool GetWasRecentlyInNetworkInterruption(uint uiMaxTicksAgo); void SetIsInNetworkInterruption(bool bInNetworkInterruption); + std::uint8_t GetPlayerScriptDebugLevel() const noexcept { return m_scriptDebugLevel; } + void SetPlayerScriptDebugLevel(std::uint8_t level) noexcept { m_scriptDebugLevel = level; } + CVector m_vecPrevBulletSyncStart; CVector m_vecPrevBulletSyncEnd; uchar m_ucPrevBulletSyncOrderCounter; @@ -136,6 +139,8 @@ class CClientPlayer final : public CClientPed unsigned long m_ulTick; bool m_bDoExtrapolatingAim; + std::uint8_t m_scriptDebugLevel{}; + bool m_bForce; CVector m_vecForcedMoveSpeed; CVector m_vecForcedTurnSpeed; diff --git a/Client/mods/deathmatch/logic/CClientVehicle.cpp b/Client/mods/deathmatch/logic/CClientVehicle.cpp index cc3993adc9..42b2215adc 100644 --- a/Client/mods/deathmatch/logic/CClientVehicle.cpp +++ b/Client/mods/deathmatch/logic/CClientVehicle.cpp @@ -1614,6 +1614,14 @@ bool CClientVehicle::SetRotorSpeed(float fSpeed) } } +bool CClientVehicle::SetWheelsRotation(float fRot1, float fRot2, float fRot3, float fRot4) noexcept +{ + if (!m_pVehicle) + return false; + + return m_pVehicle->SetVehicleWheelRotation(fRot1, fRot2, fRot3, fRot4); +} + bool CClientVehicle::IsHeliSearchLightVisible() { if (m_pVehicle && m_eVehicleType == CLIENTVEHICLE_HELI) diff --git a/Client/mods/deathmatch/logic/CClientVehicle.h b/Client/mods/deathmatch/logic/CClientVehicle.h index 1577c1c576..ff87ef00dc 100644 --- a/Client/mods/deathmatch/logic/CClientVehicle.h +++ b/Client/mods/deathmatch/logic/CClientVehicle.h @@ -302,7 +302,7 @@ class CClientVehicle : public CClientStreamElement bool GetRotorSpeed(float&); bool SetRotorSpeed(float); - + bool SetWheelsRotation(float fRot1, float fRot2, float fRot3, float fRot4) noexcept; void SetHeliRotorSpeed(float fSpeed); void SetPlaneRotorSpeed(float fSpeed); bool IsHeliSearchLightVisible(); diff --git a/Client/mods/deathmatch/logic/CPacketHandler.cpp b/Client/mods/deathmatch/logic/CPacketHandler.cpp index dd95351ed6..ed8ba623c1 100644 --- a/Client/mods/deathmatch/logic/CPacketHandler.cpp +++ b/Client/mods/deathmatch/logic/CPacketHandler.cpp @@ -1,11 +1,11 @@ /***************************************************************************** * - * PROJECT: Multi Theft Auto v1.0 + * PROJECT: Multi Theft Auto * LICENSE: See LICENSE in the top level directory - * FILE: mods/deathmatch/logic/CPacketHandler.cpp + * FILE: Client/mods/deathmatch/logic/CPacketHandler.cpp * PURPOSE: Packet handling and processing * - * Multi Theft Auto is available from http://www.multitheftauto.com/ + * Multi Theft Auto is available from https://multitheftauto.com/ * *****************************************************************************/ @@ -1226,6 +1226,8 @@ void CPacketHandler::Packet_PlayerWasted(NetBitStreamInterface& bitStream) else Arguments.PushBoolean(false); Arguments.PushBoolean(bStealth); + Arguments.PushNumber(animGroup); + Arguments.PushNumber(animID); if (IS_PLAYER(pPed)) pPed->CallEvent("onClientPlayerWasted", Arguments, true); else @@ -2390,6 +2392,7 @@ void CPacketHandler::Packet_MapInfo(NetBitStreamInterface& bitStream) g_pClientGame->SetWorldSpecialProperty(WorldSpecialProperty::FIREBALLDESTRUCT, wsProps.data2.fireballdestruct); g_pClientGame->SetWorldSpecialProperty(WorldSpecialProperty::ROADSIGNSTEXT, wsProps.data3.roadsignstext); g_pClientGame->SetWorldSpecialProperty(WorldSpecialProperty::EXTENDEDWATERCANNONS, wsProps.data4.extendedwatercannons); + g_pClientGame->SetWorldSpecialProperty(WorldSpecialProperty::TUNNELWEATHERBLEND, wsProps.data5.tunnelweatherblend); float fJetpackMaxHeight = 100; if (!bitStream.Read(fJetpackMaxHeight)) @@ -3629,7 +3632,6 @@ void CPacketHandler::Packet_EntityAdd(NetBitStreamInterface& bitStream) CClientMarker* pMarker = new CClientMarker(g_pClientGame->m_pManager, EntityID, ucType); pMarker->SetPosition(position.data.vecPosition); pMarker->SetSize(fSize); - pMarker->SetColor(color); // Entity is this pEntity = pMarker; @@ -3651,8 +3653,27 @@ void CPacketHandler::Packet_EntityAdd(NetBitStreamInterface& bitStream) pCheckpoint->SetNextPosition(position.data.vecPosition); pCheckpoint->SetIcon(CClientCheckpoint::ICON_ARROW); } + + if (ucType == CClientGame::MARKER_CHECKPOINT && bitStream.Can(eBitStreamVersion::SetMarkerTargetArrowProperties)) + { + SColor color; + float size; + bitStream.Read(color.R); + bitStream.Read(color.G); + bitStream.Read(color.B); + bitStream.Read(color.A); + bitStream.Read(size); + + pCheckpoint->SetTargetArrowProperties(color, size); + } } } + + // Read out alpha limit flag + if (bitStream.Can(eBitStreamVersion::Marker_IgnoreAlphaLimits)) + pMarker->SetIgnoreAlphaLimits(bitStream.ReadBit()); + + pMarker->SetColor(color); } else { diff --git a/Client/mods/deathmatch/logic/CResourceManager.cpp b/Client/mods/deathmatch/logic/CResourceManager.cpp index 57939c9a0e..ff072ac83f 100644 --- a/Client/mods/deathmatch/logic/CResourceManager.cpp +++ b/Client/mods/deathmatch/logic/CResourceManager.cpp @@ -150,7 +150,7 @@ void CResourceManager::StopAll() } // pResource may be changed on return, and it could be NULL if the function returns false. -bool CResourceManager::ParseResourcePathInput(std::string strInput, CResource*& pResource, std::string* pStrPath, std::string* pStrMetaPath) +bool CResourceManager::ParseResourcePathInput(std::string strInput, CResource*& pResource, std::string* pStrPath, std::string* pStrMetaPath, bool bPassSize) { ReplaceOccurrencesInString(strInput, "\\", "/"); @@ -190,7 +190,7 @@ bool CResourceManager::ParseResourcePathInput(std::string strInput, CResource*& } } } - else if (pResource && IsValidFilePath(strInput.c_str())) + else if (pResource && (bPassSize ? IsValidFilePath(strInput.c_str(), strInput.size()) : IsValidFilePath(strInput.c_str()))) { if (pStrPath) *pStrPath = pResource->GetResourceDirectoryPath(accessType, strInput); diff --git a/Client/mods/deathmatch/logic/CResourceManager.h b/Client/mods/deathmatch/logic/CResourceManager.h index d0b5e7892d..4d52e8c7ce 100644 --- a/Client/mods/deathmatch/logic/CResourceManager.h +++ b/Client/mods/deathmatch/logic/CResourceManager.h @@ -54,7 +54,7 @@ class CResourceManager void ValidateResourceFile(const SString& strFilename, const char* buffer, size_t bufferSize); CDownloadableResource* GetDownloadableResourceFile(const SString& strFilename) { return MapFindRef(m_ResourceFileMap, strFilename); } - static bool ParseResourcePathInput(std::string strInput, CResource*& pResource, std::string* pStrPath, std::string* pStrMetaPath = nullptr); + static bool ParseResourcePathInput(std::string strInput, CResource*& pResource, std::string* pStrPath, std::string* pStrMetaPath = nullptr, bool bPassSize = false); private: CMappedList m_resources; diff --git a/Client/mods/deathmatch/logic/CScriptDebugging.cpp b/Client/mods/deathmatch/logic/CScriptDebugging.cpp index fd51faf20b..4af67b1524 100644 --- a/Client/mods/deathmatch/logic/CScriptDebugging.cpp +++ b/Client/mods/deathmatch/logic/CScriptDebugging.cpp @@ -123,7 +123,9 @@ void CScriptDebugging::UpdateLogOutput() while (m_DuplicateLineFilter.PopOutputLine(line)) { // Log it to the file if enough level - if (m_uiLogFileLevel >= line.uiMinimumDebugLevel) + bool sufficientDebugLevel = CheckForSufficientDebugLevel(m_uiLogFileLevel, line.uiMinimumDebugLevel); + + if (sufficientDebugLevel) { PrintLog(line.strText); } diff --git a/Client/mods/deathmatch/logic/CScriptDebugging.h b/Client/mods/deathmatch/logic/CScriptDebugging.h index a406baa6e4..48b41b606a 100644 --- a/Client/mods/deathmatch/logic/CScriptDebugging.h +++ b/Client/mods/deathmatch/logic/CScriptDebugging.h @@ -68,6 +68,7 @@ class CScriptDebugging SString ComposeErrorMessage(const char* szPrePend, const SLuaDebugInfo& luaDebugInfo, const char* szMessage); void LogString(const char* szPrePend, const SLuaDebugInfo& luaDebugInfo, const char* szMessage, unsigned int uiMinimumDebugLevel, unsigned char ucRed = 255, unsigned char ucGreen = 255, unsigned char ucBlue = 255); + bool CheckForSufficientDebugLevel(std::uint8_t playerDebugLevel, std::uint8_t messageDebugLevel) const noexcept; void PrintLog(const char* szText); public: diff --git a/Client/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp b/Client/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp index 0bda456827..91b79f1036 100644 --- a/Client/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp +++ b/Client/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp @@ -2,10 +2,10 @@ * * PROJECT: Multi Theft Auto * LICENSE: See LICENSE in the top level directory - * FILE: mods/deathmatch/logic/CStaticFunctionDefinitions.cpp + * FILE: Client/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp * PURPOSE: Scripting function processing * - * Multi Theft Auto is available from http://www.multitheftauto.com/ + * Multi Theft Auto is available from https://multitheftauto.com/ * *****************************************************************************/ @@ -2153,7 +2153,8 @@ bool CStaticFunctionDefinitions::KillPed(CClientEntity& Entity, CClientEntity* p else Arguments.PushBoolean(false); Arguments.PushBoolean(bStealth); - + Arguments.PushBoolean(false); + Arguments.PushBoolean(false); pPed.CallEvent("onClientPedWasted", Arguments, false); pPed.RemoveAllWeapons(); @@ -2242,15 +2243,15 @@ bool CStaticFunctionDefinitions::SetPedAnimation(CClientEntity& Entity, const SS if (pIFP) { // Play the gateway animation - const SString& strGateWayBlockName = g_pGame->GetAnimManager()->GetGateWayBlockName(); - std::unique_ptr pBlock = g_pGame->GetAnimManager()->GetAnimationBlock(strGateWayBlockName); + const char* szGateWayBlockName = g_pGame->GetAnimManager()->GetGateWayBlockName(); + std::unique_ptr pBlock = g_pGame->GetAnimManager()->GetAnimationBlock(szGateWayBlockName); auto pCustomAnimBlendHierarchy = pIFP->GetAnimationHierarchy(szAnimName); if ((pBlock) && (pCustomAnimBlendHierarchy != nullptr)) { Ped.SetNextAnimationCustom(pIFP, szAnimName); - const SString& strGateWayAnimationName = g_pGame->GetAnimManager()->GetGateWayAnimationName(); - Ped.RunNamedAnimation(pBlock, strGateWayAnimationName, iTime, iBlend, bLoop, bUpdatePosition, bInterruptable, bFreezeLastFrame); + const char* szGateWayAnimationName = g_pGame->GetAnimManager()->GetGateWayAnimationName(); + Ped.RunNamedAnimation(pBlock, szGateWayAnimationName, iTime, iBlend, bLoop, bUpdatePosition, bInterruptable, bFreezeLastFrame); return true; } } @@ -4773,7 +4774,7 @@ bool CStaticFunctionDefinitions::SetBlipVisibleDistance(CClientEntity& Entity, u return false; } -CClientMarker* CStaticFunctionDefinitions::CreateMarker(CResource& Resource, const CVector& vecPosition, const char* szType, float fSize, const SColor color) +CClientMarker* CStaticFunctionDefinitions::CreateMarker(CResource& Resource, const CVector& vecPosition, const char* szType, float fSize, const SColor color, bool ignoreAlphaLimits) { assert(szType); @@ -4787,6 +4788,10 @@ CClientMarker* CStaticFunctionDefinitions::CreateMarker(CResource& Resource, con // Set its parent and its properties pMarker->SetParent(Resource.GetResourceDynamicEntity()); pMarker->SetPosition(vecPosition); + + if (ucType == CClientMarker::MARKER_ARROW || ucType == CClientMarker::MARKER_CHECKPOINT) + pMarker->SetIgnoreAlphaLimits(ignoreAlphaLimits); + pMarker->SetColor(color); pMarker->SetSize(fSize); @@ -4925,6 +4930,25 @@ bool CStaticFunctionDefinitions::SetMarkerIcon(CClientEntity& Entity, const char return false; } +bool CStaticFunctionDefinitions::SetMarkerTargetArrowProperties(CClientEntity& Entity, const SColor color, float size) +{ + RUN_CHILDREN(SetMarkerTargetArrowProperties(**iter, color, size)) + + if (!IS_MARKER(&Entity)) + return false; + + CClientMarker& marker = static_cast(Entity); + CClientCheckpoint* checkpoint = marker.GetCheckpoint(); + if (!checkpoint) + return false; + + if (checkpoint->GetIcon() != CClientCheckpoint::ICON_ARROW) + return false; + + checkpoint->SetTargetArrowProperties(color, size); + return true; +} + bool CStaticFunctionDefinitions::GetCameraMatrix(CVector& vecPosition, CVector& vecLookAt, float& fRoll, float& fFOV) { m_pCamera->GetPosition(vecPosition); diff --git a/Client/mods/deathmatch/logic/CStaticFunctionDefinitions.h b/Client/mods/deathmatch/logic/CStaticFunctionDefinitions.h index 2ffe1ff0a5..2d1ce8c88a 100644 --- a/Client/mods/deathmatch/logic/CStaticFunctionDefinitions.h +++ b/Client/mods/deathmatch/logic/CStaticFunctionDefinitions.h @@ -366,7 +366,7 @@ class CStaticFunctionDefinitions static bool SetBlipVisibleDistance(CClientEntity& Entity, unsigned short usVisibleDistance); // Marker create/destroy funcs - static CClientMarker* CreateMarker(CResource& Resource, const CVector& vecPosition, const char* szType, float fSize, const SColor color); + static CClientMarker* CreateMarker(CResource& Resource, const CVector& vecPosition, const char* szType, float fSize, const SColor color, bool ignoreAlphaLimits); // Marker get funcs static bool GetMarkerTarget(CClientMarker& Marker, CVector& vecTarget); @@ -377,6 +377,7 @@ class CStaticFunctionDefinitions static bool SetMarkerColor(CClientEntity& Entity, const SColor color); static bool SetMarkerTarget(CClientEntity& Entity, const CVector* pTarget); static bool SetMarkerIcon(CClientEntity& Entity, const char* szIcon); + static bool SetMarkerTargetArrowProperties(CClientEntity& Entity, const SColor color, float size); // Camera get funcs static bool GetCameraMatrix(CVector& vecPosition, CVector& vecLookAt, float& fRoll, float& fFOV); diff --git a/Client/mods/deathmatch/logic/lua/CLuaFunctionParseHelpers.cpp b/Client/mods/deathmatch/logic/lua/CLuaFunctionParseHelpers.cpp index 2ff7d9bd7d..7090203704 100644 --- a/Client/mods/deathmatch/logic/lua/CLuaFunctionParseHelpers.cpp +++ b/Client/mods/deathmatch/logic/lua/CLuaFunctionParseHelpers.cpp @@ -873,6 +873,29 @@ ADD_ENUM(eFxParticleSystems::PRT_WHEELDIRT, "wheel_dirt") ADD_ENUM(eFxParticleSystems::PRT_GLASS, "glass") IMPLEMENT_ENUM_CLASS_END("particle-system") +IMPLEMENT_ENUM_BEGIN(eWorldProperty) +ADD_ENUM(AMBIENT_COLOR, "AmbientColor") +ADD_ENUM(AMBIENT_OBJ_COLOR, "AmbientObjColor") +ADD_ENUM(DIRECTIONAL_COLOR, "DirectionalColor") +ADD_ENUM(SPRITE_SIZE, "SpriteSize") +ADD_ENUM(SPRITE_BRIGHTNESS, "SpriteBrightness") +ADD_ENUM(POLE_SHADOW_STRENGTH, "PoleShadowStrength") +ADD_ENUM(SHADOW_STRENGTH, "ShadowStrength") +ADD_ENUM(SHADOWS_OFFSET, "ShadowsOffset") +ADD_ENUM(LIGHTS_ON_GROUND, "LightsOnGround") +ADD_ENUM(LOW_CLOUDS_COLOR, "LowCloudsColor") +ADD_ENUM(BOTTOM_CLOUDS_COLOR, "BottomCloudsColor") +ADD_ENUM(CLOUDS_ALPHA1, "CloudsAlpha") +ADD_ENUM(ILLUMINATION, "Illumination") +ADD_ENUM(WEATHER_WET_ROADS, "WetRoads") +ADD_ENUM(WEATHER_FOGGYNESS, "Foggyness") +ADD_ENUM(WEATHER_FOG, "Fog") +ADD_ENUM(WEATHER_RAIN_FOG, "RainFog") +ADD_ENUM(WEATHER_WATER_FOG, "WaterFog") +ADD_ENUM(WEATHER_SANDSTORM, "Sandstorm") +ADD_ENUM(WEATHER_RAINBOW, "Rainbow") +IMPLEMENT_ENUM_END("world-property") + // // CResource from userdata // diff --git a/Client/mods/deathmatch/logic/lua/CLuaFunctionParseHelpers.h b/Client/mods/deathmatch/logic/lua/CLuaFunctionParseHelpers.h index aae4e759e5..9b93980d85 100644 --- a/Client/mods/deathmatch/logic/lua/CLuaFunctionParseHelpers.h +++ b/Client/mods/deathmatch/logic/lua/CLuaFunctionParseHelpers.h @@ -84,6 +84,7 @@ DECLARE_ENUM_CLASS(_D3DFORMAT); DECLARE_ENUM_CLASS(eRenderStage); DECLARE_ENUM_CLASS(eFxParticleSystems); DECLARE_ENUM(ePools); +DECLARE_ENUM(eWorldProperty); class CRemoteCall; @@ -497,6 +498,10 @@ inline SString GetClassTypeName(eSoundEffectParams::Reverb*) { return "soundeffect-params-reverb"; } +inline SString GetClassTypeName(eWorldProperty*) +{ + return "world-property"; +} inline SString GetClassTypeName(CClientVectorGraphic*) { diff --git a/Client/mods/deathmatch/logic/lua/CLuaMain.cpp b/Client/mods/deathmatch/logic/lua/CLuaMain.cpp index 4dbe913aa0..446fdc866e 100644 --- a/Client/mods/deathmatch/logic/lua/CLuaMain.cpp +++ b/Client/mods/deathmatch/logic/lua/CLuaMain.cpp @@ -170,6 +170,9 @@ void CLuaMain::InitVM() lua_pushelement(m_luaVM, m_pResource->GetResourceEntity()); lua_setglobal(m_luaVM, "resourceRoot"); + lua_pushstring(m_luaVM, m_pResource->GetName()); + lua_setglobal(m_luaVM, "resourceName"); + lua_pushelement(m_luaVM, m_pResource->GetResourceGUIEntity()); lua_setglobal(m_luaVM, "guiRoot"); diff --git a/Client/mods/deathmatch/logic/luadefs/CLuaAudioDefs.cpp b/Client/mods/deathmatch/logic/luadefs/CLuaAudioDefs.cpp index fce32a5506..593ac628da 100644 --- a/Client/mods/deathmatch/logic/luadefs/CLuaAudioDefs.cpp +++ b/Client/mods/deathmatch/logic/luadefs/CLuaAudioDefs.cpp @@ -165,7 +165,8 @@ int CLuaAudioDefs::PlaySound(lua_State* luaVM) SString strFilename; bool bIsURL = false; bool bIsRawData = false; - if (CResourceManager::ParseResourcePathInput(strSound, pResource, &strFilename)) + + if (CResourceManager::ParseResourcePathInput(strSound, pResource, &strFilename, nullptr, true)) strSound = strFilename; else { diff --git a/Client/mods/deathmatch/logic/luadefs/CLuaMarkerDefs.cpp b/Client/mods/deathmatch/logic/luadefs/CLuaMarkerDefs.cpp index 071cad3870..6bbebf60f3 100644 --- a/Client/mods/deathmatch/logic/luadefs/CLuaMarkerDefs.cpp +++ b/Client/mods/deathmatch/logic/luadefs/CLuaMarkerDefs.cpp @@ -23,12 +23,14 @@ void CLuaMarkerDefs::LoadFunctions() {"getMarkerColor", GetMarkerColor}, {"getMarkerTarget", GetMarkerTarget}, {"getMarkerIcon", GetMarkerIcon}, + {"getMarkerTargetArrowProperties", ArgumentParser}, {"setMarkerType", SetMarkerType}, {"setMarkerSize", SetMarkerSize}, {"setMarkerColor", SetMarkerColor}, {"setMarkerTarget", SetMarkerTarget}, {"setMarkerIcon", SetMarkerIcon}, + {"setMarkerTargetArrowProperties", ArgumentParser}, {"setCoronaReflectionEnabled", ArgumentParser}, {"isCoronaReflectionEnabled", ArgumentParser}, @@ -75,6 +77,7 @@ int CLuaMarkerDefs::CreateMarker(lua_State* luaVM) float fSize = 4.0f; SColorRGBA color(0, 0, 255, 255); SString strType = "default"; + bool ignoreAlphaLimits; CScriptArgReader argStream(luaVM); argStream.ReadVector3D(vecPosition); argStream.ReadString(strType, "default"); @@ -83,6 +86,7 @@ int CLuaMarkerDefs::CreateMarker(lua_State* luaVM) argStream.ReadNumber(color.G, 0); argStream.ReadNumber(color.B, 255); argStream.ReadNumber(color.A, 255); + argStream.ReadBool(ignoreAlphaLimits, false); if (!argStream.HasErrors()) { @@ -92,7 +96,7 @@ int CLuaMarkerDefs::CreateMarker(lua_State* luaVM) CResource* pResource = pLuaMain->GetResource(); { // Create it - CClientMarker* pMarker = CStaticFunctionDefinitions::CreateMarker(*pResource, vecPosition, strType, fSize, color); + CClientMarker* pMarker = CStaticFunctionDefinitions::CreateMarker(*pResource, vecPosition, strType, fSize, color, ignoreAlphaLimits); if (pMarker) { CElementGroup* pGroup = pResource->GetElementGroup(); @@ -177,7 +181,12 @@ int CLuaMarkerDefs::GetMarkerColor(lua_State* luaVM) lua_pushnumber(luaVM, static_cast(color.R)); lua_pushnumber(luaVM, static_cast(color.G)); lua_pushnumber(luaVM, static_cast(color.B)); - lua_pushnumber(luaVM, static_cast(color.A)); + + if (!pMarker->AreAlphaLimitsIgnored() && (pMarker->GetMarkerType() == CClientMarker::MARKER_CHECKPOINT || pMarker->GetMarkerType() == CClientMarker::MARKER_ARROW)) + lua_pushnumber(luaVM, 255); // fake alpha + else + lua_pushnumber(luaVM, static_cast(color.A)); + return 4; } else @@ -417,3 +426,27 @@ bool CLuaMarkerDefs::IsCoronaReflectionEnabled(CClientMarker* pMarker) return pCorona->IsReflectionEnabled(); } + +bool CLuaMarkerDefs::SetMarkerTargetArrowProperties(CClientMarker* marker, std::optional r, std::optional g, std::optional b, std::optional a, std::optional size) +{ + SColor color; + color.R = r.value_or(255); + color.G = g.value_or(64); + color.B = b.value_or(64); + color.A = a.value_or(255); + + return CStaticFunctionDefinitions::SetMarkerTargetArrowProperties(*marker, color, size.value_or(marker->GetSize() * 0.625f)); +} + +std::variant, bool> CLuaMarkerDefs::GetMarkerTargetArrowProperties(CClientMarker* marker) noexcept +{ + CClientCheckpoint* checkpoint = marker->GetCheckpoint(); + if (!checkpoint) + return false; + + if (!checkpoint->HasTarget() || marker->GetMarkerType() != CClientMarker::MARKER_CHECKPOINT) + return false; + + SColor color = checkpoint->GetTargetArrowColor(); + return CLuaMultiReturn(color.R, color.G, color.B, color.A, checkpoint->GetTargetArrowSize()); +} diff --git a/Client/mods/deathmatch/logic/luadefs/CLuaMarkerDefs.h b/Client/mods/deathmatch/logic/luadefs/CLuaMarkerDefs.h index 6f0c1c0abb..3e351490b5 100644 --- a/Client/mods/deathmatch/logic/luadefs/CLuaMarkerDefs.h +++ b/Client/mods/deathmatch/logic/luadefs/CLuaMarkerDefs.h @@ -11,6 +11,7 @@ #pragma once #include "CLuaDefs.h" +#include "lua/CLuaMultiReturn.h" class CLuaMarkerDefs : public CLuaDefs { @@ -35,4 +36,7 @@ class CLuaMarkerDefs : public CLuaDefs static bool SetCoronaReflectionEnabled(CClientMarker* pMarker, bool bEnabled); static bool IsCoronaReflectionEnabled(CClientMarker* pMarker); + + static bool SetMarkerTargetArrowProperties(CClientMarker* marker, std::optional r, std::optional g, std::optional b, std::optional a, std::optional size); + static std::variant, bool> GetMarkerTargetArrowProperties(CClientMarker* marker) noexcept; }; diff --git a/Client/mods/deathmatch/logic/luadefs/CLuaPlayerDefs.cpp b/Client/mods/deathmatch/logic/luadefs/CLuaPlayerDefs.cpp index 023b1c4191..757a4d5419 100644 --- a/Client/mods/deathmatch/logic/luadefs/CLuaPlayerDefs.cpp +++ b/Client/mods/deathmatch/logic/luadefs/CLuaPlayerDefs.cpp @@ -28,6 +28,7 @@ void CLuaPlayerDefs::LoadFunctions() {"isPlayerHudComponentVisible", IsPlayerHudComponentVisible}, {"getPlayerMoney", GetPlayerMoney}, {"getPlayerWantedLevel", GetPlayerWantedLevel}, + {"getPlayerScriptDebugLevel", ArgumentParser}, // Player set funcs {"showPlayerHudComponent", ShowPlayerHudComponent}, @@ -87,12 +88,14 @@ void CLuaPlayerDefs::AddClass(lua_State* luaVM) lua_classfunction(luaVM, "getTeam", "getPlayerTeam"); lua_classfunction(luaVM, "getNametagText", "getPlayerNametagText"); lua_classfunction(luaVM, "getNametagColor", "getPlayerNametagColor"); + lua_classfunction(luaVM, "getScriptDebugLevel", "getPlayerScriptDebugLevel"); lua_classfunction(luaVM, "isNametagShowing", "isPlayerNametagShowing"); lua_classvariable(luaVM, "ping", NULL, "getPlayerPing"); lua_classvariable(luaVM, "name", NULL, "getPlayerName"); lua_classvariable(luaVM, "team", NULL, "getPlayerTeam"); + lua_classvariable(luaVM, "scriptDebugLevel", nullptr, "getPlayerScriptDebugLevel"); lua_classvariable(luaVM, "nametagText", "setPlayerNametagText", "getPlayerNametagText"); lua_classvariable(luaVM, "nametagShowing", "setPlayerNametagShowing", "isPlayerNametagShowing"); @@ -309,6 +312,11 @@ int CLuaPlayerDefs::GetPlayerWantedLevel(lua_State* luaVM) return 1; } +std::uint8_t CLuaPlayerDefs::GetPlayerScriptDebugLevel() noexcept +{ + return g_pClientGame->GetPlayerManager()->GetLocalPlayer()->GetPlayerScriptDebugLevel(); +} + int CLuaPlayerDefs::ShowPlayerHudComponent(lua_State* luaVM) { // bool showPlayerHudComponent ( string component, bool show ) diff --git a/Client/mods/deathmatch/logic/luadefs/CLuaPlayerDefs.h b/Client/mods/deathmatch/logic/luadefs/CLuaPlayerDefs.h index fbe910c4ca..918acec6b6 100644 --- a/Client/mods/deathmatch/logic/luadefs/CLuaPlayerDefs.h +++ b/Client/mods/deathmatch/logic/luadefs/CLuaPlayerDefs.h @@ -29,6 +29,7 @@ class CLuaPlayerDefs : public CLuaDefs LUA_DECLARE(GetPlayerTeam); LUA_DECLARE(GetPlayerMoney); LUA_DECLARE(GetPlayerWantedLevel); + static std::uint8_t GetPlayerScriptDebugLevel() noexcept; // Player set LUA_DECLARE(ShowPlayerHudComponent); diff --git a/Client/mods/deathmatch/logic/luadefs/CLuaResourceDefs.cpp b/Client/mods/deathmatch/logic/luadefs/CLuaResourceDefs.cpp index 62a8b2f531..113d810f68 100644 --- a/Client/mods/deathmatch/logic/luadefs/CLuaResourceDefs.cpp +++ b/Client/mods/deathmatch/logic/luadefs/CLuaResourceDefs.cpp @@ -10,6 +10,8 @@ *****************************************************************************/ #include "StdInc.h" +#include + using std::list; void CLuaResourceDefs::LoadFunctions() @@ -18,7 +20,7 @@ void CLuaResourceDefs::LoadFunctions() {"call", Call}, {"getThisResource", GetThisResource}, {"getResourceConfig", GetResourceConfig}, - {"getResourceName", GetResourceName}, + {"getResourceName", ArgumentParserWarn}, {"getResourceFromName", GetResourceFromName}, {"getResourceRootElement", GetResourceRootElement}, {"getResourceGUIElement", GetResourceGUIElement}, @@ -220,34 +222,17 @@ int CLuaResourceDefs::GetResourceConfig(lua_State* luaVM) return 1; } -int CLuaResourceDefs::GetResourceName(lua_State* luaVM) +std::string CLuaResourceDefs::GetResourceName(lua_State* luaVM, std::optional resourceElement) { - // Verify arguments - CResource* pResource = NULL; - CScriptArgReader argStream(luaVM); - argStream.ReadUserData(pResource); + if (resourceElement.has_value()) + return (*resourceElement)->GetName(); - if (!argStream.HasErrors()) - { - if (pResource) - { - // Grab its name and return it - const char* szName = pResource->GetName(); - if (szName) - { - lua_pushstring(luaVM, szName); - return 1; - } - } - else - m_pScriptDebugging->LogBadPointer(luaVM, "resource", 1); - } - else - m_pScriptDebugging->LogCustom(luaVM, argStream.GetFullErrorMessage()); + CResource* localResource = &lua_getownerresource(luaVM); - // Failed - lua_pushboolean(luaVM, false); - return 1; + if (!localResource) + throw std::invalid_argument("Couldn't find the resource"); + + return localResource->GetName(); } int CLuaResourceDefs::GetResourceFromName(lua_State* luaVM) diff --git a/Client/mods/deathmatch/logic/luadefs/CLuaResourceDefs.h b/Client/mods/deathmatch/logic/luadefs/CLuaResourceDefs.h index deb8fe9a90..eba15fa6c7 100644 --- a/Client/mods/deathmatch/logic/luadefs/CLuaResourceDefs.h +++ b/Client/mods/deathmatch/logic/luadefs/CLuaResourceDefs.h @@ -21,7 +21,6 @@ class CLuaResourceDefs : public CLuaDefs LUA_DECLARE(Call); LUA_DECLARE(GetThisResource); LUA_DECLARE(GetResourceConfig); - LUA_DECLARE(GetResourceName); LUA_DECLARE(GetResourceFromName); LUA_DECLARE(GetResourceRootElement); LUA_DECLARE(GetResourceGUIElement); @@ -30,4 +29,6 @@ class CLuaResourceDefs : public CLuaDefs LUA_DECLARE(GetResourceState); LUA_DECLARE(LoadString); LUA_DECLARE(Load); + + static std::string GetResourceName(lua_State* luaVM, std::optional resourceElement); }; diff --git a/Client/mods/deathmatch/logic/luadefs/CLuaVehicleDefs.cpp b/Client/mods/deathmatch/logic/luadefs/CLuaVehicleDefs.cpp index ddab0e01e8..b26b2163e4 100644 --- a/Client/mods/deathmatch/logic/luadefs/CLuaVehicleDefs.cpp +++ b/Client/mods/deathmatch/logic/luadefs/CLuaVehicleDefs.cpp @@ -120,6 +120,7 @@ void CLuaVehicleDefs::LoadFunctions() {"setVehicleAdjustableProperty", SetVehicleAdjustableProperty}, {"setHelicopterRotorSpeed", SetHelicopterRotorSpeed}, {"setVehicleRotorSpeed", ArgumentParser}, + {"setVehicleWheelsRotation", ArgumentParser}, {"setTrainDerailed", SetTrainDerailed}, {"setTrainDerailable", SetTrainDerailable}, {"setTrainDirection", SetTrainDirection}, @@ -2222,6 +2223,11 @@ bool CLuaVehicleDefs::SetVehicleRotorSpeed(CClientVehicle* pVehicle, float fSpee return pVehicle->SetRotorSpeed(fSpeed); } +bool CLuaVehicleDefs::SetVehicleWheelsRotation(CClientVehicle* pVehicle, float fRotation) noexcept +{ + return pVehicle->SetWheelsRotation(fRotation, fRotation, fRotation, fRotation); +} + int CLuaVehicleDefs::SetTrainDerailed(lua_State* luaVM) { CClientVehicle* pVehicle = NULL; diff --git a/Client/mods/deathmatch/logic/luadefs/CLuaVehicleDefs.h b/Client/mods/deathmatch/logic/luadefs/CLuaVehicleDefs.h index 87f40c848f..cf73032a7f 100644 --- a/Client/mods/deathmatch/logic/luadefs/CLuaVehicleDefs.h +++ b/Client/mods/deathmatch/logic/luadefs/CLuaVehicleDefs.h @@ -119,6 +119,7 @@ class CLuaVehicleDefs : public CLuaDefs LUA_DECLARE(SetVehicleAdjustableProperty); LUA_DECLARE(SetHelicopterRotorSpeed); static bool SetVehicleRotorSpeed(CClientVehicle* pVehicle, float fSpeed); + static bool SetVehicleWheelsRotation(CClientVehicle* pVehicle, float fRotation) noexcept; LUA_DECLARE(SetTrainDerailed); LUA_DECLARE(SetTrainDerailable); LUA_DECLARE(SetTrainDirection); diff --git a/Client/mods/deathmatch/logic/luadefs/CLuaWorldDefs.cpp b/Client/mods/deathmatch/logic/luadefs/CLuaWorldDefs.cpp index 40f5b345da..96dd447921 100644 --- a/Client/mods/deathmatch/logic/luadefs/CLuaWorldDefs.cpp +++ b/Client/mods/deathmatch/logic/luadefs/CLuaWorldDefs.cpp @@ -58,6 +58,7 @@ void CLuaWorldDefs::LoadFunctions() {"getFPSLimit", GetFPSLimit}, {"getBirdsEnabled", GetBirdsEnabled}, {"getCoronaReflectionsEnabled", ArgumentParser}, + {"getWorldProperty", ArgumentParser}, // World set funcs {"setTime", SetTime}, @@ -73,7 +74,7 @@ void CLuaWorldDefs::LoadFunctions() {"setWaveHeight", SetWaveHeight}, {"setMinuteDuration", SetMinuteDuration}, {"setGarageOpen", SetGarageOpen}, - {"setWorldSpecialPropertyEnabled", ArgumentParserWarn}, + {"setWorldSpecialPropertyEnabled", ArgumentParser}, {"setBlurLevel", SetBlurLevel}, {"setJetpackMaxHeight", SetJetpackMaxHeight}, {"setCloudsEnabled", SetCloudsEnabled}, @@ -98,6 +99,7 @@ void CLuaWorldDefs::LoadFunctions() {"setMoonSize", SetMoonSize}, {"setFPSLimit", SetFPSLimit}, {"setCoronaReflectionsEnabled", ArgumentParser}, + {"setWorldProperty", ArgumentParser}, {"removeWorldModel", RemoveWorldBuilding}, {"restoreAllWorldModels", RestoreWorldBuildings}, {"restoreWorldModel", RestoreWorldBuilding}, @@ -122,6 +124,7 @@ void CLuaWorldDefs::LoadFunctions() {"resetSunSize", ResetSunSize}, {"resetMoonSize", ResetMoonSize}, {"resetBlurLevel", ResetBlurLevel}, + {"resetWorldProperty", ArgumentParserWarn}, // World check funcs {"areTrafficLightsLocked", AreTrafficLightsLocked}, @@ -2060,3 +2063,174 @@ bool CLuaWorldDefs::ResetCoronaReflectionsEnabled() g_pGame->GetSettings()->ResetCoronaReflectionsEnabled(); return true; } + +std::variant> CLuaWorldDefs::GetWorldProperty(eWorldProperty property) +{ + switch (property) + { + case eWorldProperty::AMBIENT_COLOR: + { + float red, green, blue; + g_pMultiplayer->GetAmbientColor(red, green, blue); + return std::make_tuple((int16)(red * 255), (int16)(green * 255), (int16)(blue * 255)); + } + case eWorldProperty::AMBIENT_OBJ_COLOR: + { + float red, green, blue; + g_pMultiplayer->GetAmbientObjectColor(red, green, blue); + return std::make_tuple((int16)(red * 255), (int16)(green * 255), (int16)(blue * 255)); + } + case eWorldProperty::DIRECTIONAL_COLOR: + { + float red, green, blue; + g_pMultiplayer->GetDirectionalColor(red, green, blue); + return std::make_tuple((int16)(red * 255), (int16)(green * 255), (int16)(blue * 255)); + } + case eWorldProperty::SPRITE_SIZE: + return g_pMultiplayer->GetSpriteSize(); + case eWorldProperty::SPRITE_BRIGHTNESS: + return g_pMultiplayer->GetSpriteBrightness(); + case eWorldProperty::POLE_SHADOW_STRENGTH: + return (float)g_pMultiplayer->GetPoleShadowStrength(); + case eWorldProperty::SHADOW_STRENGTH: + return (float)g_pMultiplayer->GetShadowStrength(); + case eWorldProperty::SHADOWS_OFFSET: + return g_pMultiplayer->GetShadowsOffset(); + case eWorldProperty::LIGHTS_ON_GROUND: + return g_pMultiplayer->GetLightsOnGroundBrightness(); + case eWorldProperty::LOW_CLOUDS_COLOR: + { + int16 red, green, blue; + g_pMultiplayer->GetLowCloudsColor(red, green, blue); + return std::make_tuple(red, green, blue); + } + case eWorldProperty::BOTTOM_CLOUDS_COLOR: + { + int16 red, green, blue; + g_pMultiplayer->GetBottomCloudsColor(red, green, blue); + return std::make_tuple(red, green, blue); + } + case eWorldProperty::CLOUDS_ALPHA1: + return g_pMultiplayer->GetCloudsAlpha1(); + case eWorldProperty::ILLUMINATION: + return g_pMultiplayer->GetIllumination(); + case eWorldProperty::WEATHER_WET_ROADS: + return g_pGame->GetWeather()->GetWetRoads(); + case eWorldProperty::WEATHER_FOGGYNESS: + return g_pGame->GetWeather()->GetFoggyness(); + case eWorldProperty::WEATHER_FOG: + return g_pGame->GetWeather()->GetFog(); + case eWorldProperty::WEATHER_RAIN_FOG: + return g_pGame->GetWeather()->GetRainFog(); + case eWorldProperty::WEATHER_WATER_FOG: + return g_pGame->GetWeather()->GetWaterFog(); + case eWorldProperty::WEATHER_SANDSTORM: + return g_pGame->GetWeather()->GetSandstorm(); + case eWorldProperty::WEATHER_RAINBOW: + return g_pGame->GetWeather()->GetRainbow(); + } + return false; +} + +bool CLuaWorldDefs::SetWorldProperty(eWorldProperty property, float arg1, std::optional arg2, std::optional arg3) +{ + if (arg2.has_value() && arg3.has_value()) + { + switch (property) + { + case eWorldProperty::AMBIENT_COLOR: + return g_pMultiplayer->SetAmbientColor(arg1 / 255, arg2.value() / 255, arg3.value() / 255); + case eWorldProperty::AMBIENT_OBJ_COLOR: + return g_pMultiplayer->SetAmbientObjectColor(arg1 / 255, arg2.value() / 255, arg3.value() / 255); + case eWorldProperty::DIRECTIONAL_COLOR: + return g_pMultiplayer->SetDirectionalColor(arg1 / 255, arg2.value() / 255, arg3.value() / 255); + case eWorldProperty::LOW_CLOUDS_COLOR: + return g_pMultiplayer->SetLowCloudsColor((int16)arg1, (int16)arg2.value(), (int16)arg3.value()); + case eWorldProperty::BOTTOM_CLOUDS_COLOR: + return g_pMultiplayer->SetBottomCloudsColor((int16)arg1, (int16)arg2.value(), (int16)arg3.value()); + } + return false; + } + switch (property) + { + case eWorldProperty::SPRITE_SIZE: + return g_pMultiplayer->SetSpriteSize(arg1); + case eWorldProperty::SPRITE_BRIGHTNESS: + return g_pMultiplayer->SetSpriteBrightness(arg1); + case eWorldProperty::POLE_SHADOW_STRENGTH: + return g_pMultiplayer->SetPoleShadowStrength(arg1); + case eWorldProperty::SHADOW_STRENGTH: + return g_pMultiplayer->SetShadowStrength(arg1); + case eWorldProperty::SHADOWS_OFFSET: + return g_pMultiplayer->SetShadowsOffset(arg1); + case eWorldProperty::LIGHTS_ON_GROUND: + return g_pMultiplayer->SetLightsOnGroundBrightness(arg1); + case eWorldProperty::CLOUDS_ALPHA1: + return g_pMultiplayer->SetCloudsAlpha1(arg1); + case eWorldProperty::ILLUMINATION: + return g_pMultiplayer->SetIllumination(arg1); + case eWorldProperty::WEATHER_WET_ROADS: + return g_pGame->GetWeather()->SetWetRoads(arg1); + case eWorldProperty::WEATHER_FOGGYNESS: + return g_pGame->GetWeather()->SetFoggyness(arg1); + case eWorldProperty::WEATHER_FOG: + return g_pGame->GetWeather()->SetFog(arg1); + case eWorldProperty::WEATHER_RAIN_FOG: + return g_pGame->GetWeather()->SetRainFog(arg1); + case eWorldProperty::WEATHER_WATER_FOG: + return g_pGame->GetWeather()->SetWaterFog(arg1); + case eWorldProperty::WEATHER_SANDSTORM: + return g_pGame->GetWeather()->SetSandstorm(arg1); + case eWorldProperty::WEATHER_RAINBOW: + return g_pGame->GetWeather()->SetRainbow(arg1); + } + return false; +} + +bool CLuaWorldDefs::ResetWorldProperty(eWorldProperty property) +{ + switch (property) + { + case eWorldProperty::AMBIENT_COLOR: + return g_pMultiplayer->ResetAmbientColor(); + case eWorldProperty::AMBIENT_OBJ_COLOR: + return g_pMultiplayer->ResetAmbientObjectColor(); + case eWorldProperty::DIRECTIONAL_COLOR: + return g_pMultiplayer->ResetDirectionalColor(); + case eWorldProperty::SPRITE_SIZE: + return g_pMultiplayer->ResetSpriteSize(); + case eWorldProperty::SPRITE_BRIGHTNESS: + return g_pMultiplayer->ResetSpriteBrightness(); + case eWorldProperty::POLE_SHADOW_STRENGTH: + return g_pMultiplayer->ResetPoleShadowStrength(); + case eWorldProperty::SHADOW_STRENGTH: + return g_pMultiplayer->ResetShadowStrength(); + case eWorldProperty::SHADOWS_OFFSET: + return g_pMultiplayer->ResetShadowsOffset(); + case eWorldProperty::LIGHTS_ON_GROUND: + return g_pMultiplayer->ResetLightsOnGroundBrightness(); + case eWorldProperty::LOW_CLOUDS_COLOR: + return g_pMultiplayer->ResetLowCloudsColor(); + case eWorldProperty::BOTTOM_CLOUDS_COLOR: + return g_pMultiplayer->ResetBottomCloudsColor(); + case eWorldProperty::CLOUDS_ALPHA1: + return g_pMultiplayer->ResetCloudsAlpha1(); + case eWorldProperty::ILLUMINATION: + return g_pMultiplayer->ResetIllumination(); + case eWorldProperty::WEATHER_WET_ROADS: + return g_pGame->GetWeather()->ResetWetRoads(); + case eWorldProperty::WEATHER_FOGGYNESS: + return g_pGame->GetWeather()->ResetFoggyness(); + case eWorldProperty::WEATHER_FOG: + return g_pGame->GetWeather()->ResetFog(); + case eWorldProperty::WEATHER_RAIN_FOG: + return g_pGame->GetWeather()->ResetRainFog(); + case eWorldProperty::WEATHER_WATER_FOG: + return g_pGame->GetWeather()->ResetWaterFog(); + case eWorldProperty::WEATHER_SANDSTORM: + return g_pGame->GetWeather()->ResetSandstorm(); + case eWorldProperty::WEATHER_RAINBOW: + return g_pGame->GetWeather()->ResetRainbow(); + } + return false; +} diff --git a/Client/mods/deathmatch/logic/luadefs/CLuaWorldDefs.h b/Client/mods/deathmatch/logic/luadefs/CLuaWorldDefs.h index bc90a4745e..fc1d6bb3a1 100644 --- a/Client/mods/deathmatch/logic/luadefs/CLuaWorldDefs.h +++ b/Client/mods/deathmatch/logic/luadefs/CLuaWorldDefs.h @@ -126,4 +126,8 @@ class CLuaWorldDefs : public CLuaDefs static bool SetCoronaReflectionsEnabled(uchar ucEnabled); static uchar GetCoronaReflectionsEnabled(); static bool ResetCoronaReflectionsEnabled(); + + static std::variant> GetWorldProperty(eWorldProperty property); + static bool SetWorldProperty(eWorldProperty property, float arg1, std::optional arg2, std::optional arg3); + static bool ResetWorldProperty(eWorldProperty property); }; diff --git a/Client/mods/deathmatch/logic/rpc/CMarkerRPCs.cpp b/Client/mods/deathmatch/logic/rpc/CMarkerRPCs.cpp index 25fef9a579..ab7ca26af0 100644 --- a/Client/mods/deathmatch/logic/rpc/CMarkerRPCs.cpp +++ b/Client/mods/deathmatch/logic/rpc/CMarkerRPCs.cpp @@ -19,6 +19,7 @@ void CMarkerRPCs::LoadFunctions() AddHandler(SET_MARKER_SIZE, SetMarkerSize, "SetMarkerSize"); AddHandler(SET_MARKER_TARGET, SetMarkerTarget, "SetMarkerTarget"); AddHandler(SET_MARKER_ICON, SetMarkerIcon, "SetMarkerIcon"); + AddHandler(SET_MARKER_TARGET_ARROW_PROPERTIES, SetMarkerTargetArrowProperties, "SetMarkerTargetArrowProperties"); } void CMarkerRPCs::SetMarkerType(CClientEntity* pSource, NetBitStreamInterface& bitStream) @@ -137,4 +138,22 @@ void CMarkerRPCs::SetMarkerIcon(CClientEntity* pSource, NetBitStreamInterface& b } } } -} \ No newline at end of file +} + +void CMarkerRPCs::SetMarkerTargetArrowProperties(CClientEntity* pSource, NetBitStreamInterface& bitStream) +{ + SColor color; + float size; + if (bitStream.Read(color.R) && bitStream.Read(color.G) && bitStream.Read(color.B) && bitStream.Read(color.A) && bitStream.Read(size)) + { + CClientMarker* marker = m_pMarkerManager->Get(pSource->GetID()); + if (!marker) + return; + + CClientCheckpoint* checkpoint = marker->GetCheckpoint(); + if (!checkpoint) + return; + + checkpoint->SetTargetArrowProperties(color, size); + } +} diff --git a/Client/mods/deathmatch/logic/rpc/CMarkerRPCs.h b/Client/mods/deathmatch/logic/rpc/CMarkerRPCs.h index ae4f27c41c..20dcceff15 100644 --- a/Client/mods/deathmatch/logic/rpc/CMarkerRPCs.h +++ b/Client/mods/deathmatch/logic/rpc/CMarkerRPCs.h @@ -23,4 +23,5 @@ class CMarkerRPCs : public CRPCFunctions DECLARE_ELEMENT_RPC(SetMarkerSize); DECLARE_ELEMENT_RPC(SetMarkerTarget); DECLARE_ELEMENT_RPC(SetMarkerIcon); + DECLARE_ELEMENT_RPC(SetMarkerTargetArrowProperties); }; diff --git a/Client/mods/deathmatch/logic/rpc/CPlayerRPCs.cpp b/Client/mods/deathmatch/logic/rpc/CPlayerRPCs.cpp index 6756bace22..e8cda43283 100644 --- a/Client/mods/deathmatch/logic/rpc/CPlayerRPCs.cpp +++ b/Client/mods/deathmatch/logic/rpc/CPlayerRPCs.cpp @@ -23,6 +23,7 @@ void CPlayerRPCs::LoadFunctions() AddHandler(SET_PLAYER_NAMETAG_SHOWING, SetPlayerNametagShowing, "SetPlayerNametagShowing"); AddHandler(SET_PLAYER_TEAM, SetPlayerTeam, "SetPlayerTeam"); AddHandler(TAKE_PLAYER_SCREEN_SHOT, TakePlayerScreenShot, "TakePlayerScreenShot"); + AddHandler(SET_PLAYER_SCRIPT_DEBUG_LEVEL, SetPlayerScriptDebugLevel, "SetPlayerScriptDebugLevel"); } void CPlayerRPCs::SetPlayerMoney(NetBitStreamInterface& bitStream) @@ -168,3 +169,18 @@ void CPlayerRPCs::TakePlayerScreenShot(NetBitStreamInterface& bitStream) m_pClientGame->TakePlayerScreenShot(usSizeX, usSizeY, strTag, ucQuality, uiMaxBandwidth, usMaxPacketSize, pResource, uiServerSentTime); } + +void CPlayerRPCs::SetPlayerScriptDebugLevel(NetBitStreamInterface& stream) +{ + CClientPlayer* localPlayer = g_pClientGame->GetPlayerManager()->GetLocalPlayer(); + + if (!localPlayer) + return; + + std::uint8_t scriptDebugLevel; + + if (!stream.Read(scriptDebugLevel)) + return; + + localPlayer->SetPlayerScriptDebugLevel(scriptDebugLevel); +} diff --git a/Client/mods/deathmatch/logic/rpc/CPlayerRPCs.h b/Client/mods/deathmatch/logic/rpc/CPlayerRPCs.h index ec60fd2c35..c9ab8c3e28 100644 --- a/Client/mods/deathmatch/logic/rpc/CPlayerRPCs.h +++ b/Client/mods/deathmatch/logic/rpc/CPlayerRPCs.h @@ -27,4 +27,5 @@ class CPlayerRPCs : public CRPCFunctions DECLARE_ELEMENT_RPC(SetPlayerNametagShowing); DECLARE_ELEMENT_RPC(SetPlayerTeam); DECLARE_RPC(TakePlayerScreenShot); + DECLARE_RPC(SetPlayerScriptDebugLevel); }; diff --git a/Client/multiplayer_sa/CMultiplayerSA.cpp b/Client/multiplayer_sa/CMultiplayerSA.cpp index 7dbb168fcb..70ec1b09e2 100644 --- a/Client/multiplayer_sa/CMultiplayerSA.cpp +++ b/Client/multiplayer_sa/CMultiplayerSA.cpp @@ -268,6 +268,13 @@ DWORD JMP_DynamicObject_Cond_Zero = 0x548E98; DWORD RETURN_CGlass_WindowRespondsToCollision = 0x71BC48; #define HOOKPOS_CGlass__BreakGlassPhysically 0x71D14B DWORD RETURN_CGlass__BreakGlassPhysically = 0x71D150; +#define HOOKPOS_CGlass_WindowRespondsToExplosion 0x71C255 +DWORD RETURN_CGlass_WindowRespondsToExplosion = 0x71C25A; +constexpr const DWORD CALL_FROM_CGlass_WindowRespondsToExplosion = 0x71C28E; +constexpr const DWORD CALL_FROM_CGlass_WasGlassHitByBullet = 0x71C192; +constexpr const DWORD CALL_FROM_CPhysical_ApplyCollision = 0x548F39; +constexpr const DWORD CALL_FROM_CPhysical_ApplyCollision_2 = 0x5490AE; +constexpr const DWORD CALL_FROM_CPhysical_ApplySoftCollision = 0x54A816; #define HOOKPOS_FxManager_c__DestroyFxSystem 0x4A989A @@ -327,6 +334,32 @@ BYTE ucSkyGradientTopB = 0; BYTE ucSkyGradientBottomR = 0; BYTE ucSkyGradientBottomG = 0; BYTE ucSkyGradientBottomB = 0; + +bool bUsingCustomAmbientColor = false; +float fAmbientColorR = 0.0F; +float fAmbientColorG = 0.0F; +float fAmbientColorB = 0.0F; + +bool bUsingCustomAmbientObjectColor = false; +float fAmbientObjectColorR = 0.0F; +float fAmbientObjectColorG = 0.0F; +float fAmbientObjectColorB = 0.0F; + +bool bUsingCustomDirectionalColor = false; +float fDirectionalColorR = 0.0F; +float fDirectionalColorG = 0.0F; +float fDirectionalColorB = 0.0F; + +bool bUsingCustomLowCloudsColor = false; +int16 iLowCloudsColorR = 0; +int16 iLowCloudsColorG = 0; +int16 iLowCloudsColorB = 0; + +bool bUsingCustomBottomCloudsColor = false; +int16 iBottomCloudsColorR = 0; +int16 iBottomCloudsColorG = 0; +int16 iBottomCloudsColorB = 0; + bool bUsingCustomWaterColor = false; float fWaterColorR = 0.0F; float fWaterColorG = 0.0F; @@ -526,6 +559,7 @@ void HOOK_CObject_ProcessBreak(); void HOOK_CObject_ProcessCollision(); void HOOK_CGlass_WindowRespondsToCollision(); void HOOK_CGlass__BreakGlassPhysically(); +void HOOK_CGlass_WindowRespondsToExplosion(); // get attacker & object void HOOK_FxManager_c__DestroyFxSystem(); @@ -720,7 +754,8 @@ void CMultiplayerSA::InitHooks() HookInstall(HOOKPOS_CObject_ProcessCollision, (DWORD)HOOK_CObject_ProcessCollision, 10); HookInstall(HOOKPOS_CGlass_WindowRespondsToCollision, (DWORD)HOOK_CGlass_WindowRespondsToCollision, 8); HookInstall(HOOKPOS_CGlass__BreakGlassPhysically, (DWORD)HOOK_CGlass__BreakGlassPhysically, 5); - + HookInstall(HOOKPOS_CGlass_WindowRespondsToExplosion, (DWORD)HOOK_CGlass_WindowRespondsToExplosion, 5); + // Post-destruction hook for FxSystems HookInstall(HOOKPOS_FxManager_c__DestroyFxSystem, (DWORD)HOOK_FxManager_c__DestroyFxSystem, 5); @@ -1488,7 +1523,7 @@ void CMultiplayerSA::InitHooks() fDuckingHealthThreshold = 0; // Lower the GTA shadows offset closer to ground/floor level - m_fShadowsOffset = 0.013f; // GTA default = 0.06f + m_fShadowsOffset = DEFAULT_SHADOWS_OFFSET; for (auto uiAddr : shadowAddr) MemPut(uiAddr, &m_fShadowsOffset); @@ -1529,6 +1564,10 @@ void CMultiplayerSA::InitHooks() MemPut(0x524084, 0xFF); MemPut(0x524089, 0xFF); + // Allow change alpha for arrow & checkpoint markers (#1860) + MemSet((void*)0x7225F5, 0x90, 4); + MemCpy((void*)0x725DDE, "\xFF\x76\xB\x90\x90", 5); + InitHooks_CrashFixHacks(); // Init our 1.3 hooks. @@ -2230,6 +2269,302 @@ void CMultiplayerSA::ResetWater() MemPut(0x7051D7, 184); } +void CMultiplayerSA::GetAmbientColor(float& red, float& green, float& blue) const +{ + if (bUsingCustomAmbientColor) + red = fAmbientColorR, green = fAmbientColorG, blue = fAmbientColorB; + else + red = *(float*)0xB7C4A0, green = *(float*)0xB7C4A4, blue = *(float*)0xB7C4A8; +} + +bool CMultiplayerSA::SetAmbientColor(float red, float green, float blue) +{ + bUsingCustomAmbientColor = true; + fAmbientColorR = red; + fAmbientColorG = green; + fAmbientColorB = blue; + return true; +} + +bool CMultiplayerSA::ResetAmbientColor() +{ + bUsingCustomAmbientColor = false; + return true; +} + +void CMultiplayerSA::GetAmbientObjectColor(float& red, float& green, float& blue) const +{ + if (bUsingCustomAmbientObjectColor) + red = fAmbientObjectColorR, green = fAmbientObjectColorG, blue = fAmbientObjectColorB; + else + red = *(float*)0xB7C4AC, green = *(float*)0xB7C4B0, blue = *(float*)0xB7C4B4; +} + +bool CMultiplayerSA::SetAmbientObjectColor(float red, float green, float blue) +{ + bUsingCustomAmbientObjectColor = true; + fAmbientObjectColorR = red; + fAmbientObjectColorG = green; + fAmbientObjectColorB = blue; + return true; +} + +bool CMultiplayerSA::ResetAmbientObjectColor() +{ + bUsingCustomAmbientObjectColor = false; + return true; +} + +void CMultiplayerSA::GetDirectionalColor(float& red, float& green, float& blue) const +{ + if (bUsingCustomDirectionalColor) + red = fDirectionalColorR, green = fDirectionalColorG, blue = fDirectionalColorB; + else + red = *(float*)0xB7C4B8, green = *(float*)0xB7C4BC, blue = *(float*)0xB7C4C0; +} + +bool CMultiplayerSA::SetDirectionalColor(float red, float green, float blue) +{ + bUsingCustomDirectionalColor = true; + fDirectionalColorR = red; + fDirectionalColorG = green; + fDirectionalColorB = blue; + return true; +} + +bool CMultiplayerSA::ResetDirectionalColor() +{ + bUsingCustomDirectionalColor = false; + return true; +} + +float CMultiplayerSA::GetSpriteSize() const +{ + return *(float*)0xB7C4E0; +} + +bool CMultiplayerSA::SetSpriteSize(float size) +{ + MemPut(0x55FC21, 0xDD); + MemPut(0x55FC22, 0xD8); + MemPut(0x55FC23, 0x90); + + MemPutFast(0xB7C4E0, size); + return true; +} + +bool CMultiplayerSA::ResetSpriteSize() +{ + MemPut(0x55FC21, 0xD9); + MemPut(0x55FC22, 0x5E); + MemPut(0x55FC23, 0x40); + return true; +} + +float CMultiplayerSA::GetSpriteBrightness() const +{ + return *(float*)0xB7C4E4; +} + +bool CMultiplayerSA::SetSpriteBrightness(float brightness) +{ + MemPut(0x55FC34, 0xDD); + MemPut(0x55FC35, 0xD8); + MemPut(0x55FC36, 0x90); + + MemPutFast(0xB7C4E4, brightness); + return true; +} + +bool CMultiplayerSA::ResetSpriteBrightness() +{ + MemPut(0x55FC34, 0xD9); + MemPut(0x55FC35, 0x5E); + MemPut(0x55FC36, 0x44); + return true; +} + +int16 CMultiplayerSA::GetPoleShadowStrength() const +{ + return *(int16*)0xB7C4EC; +} + +bool CMultiplayerSA::SetPoleShadowStrength(int16 strength) +{ + MemSet((LPVOID)0x55FCB8, 0x90, 4); + MemSet((LPVOID)(0x56023A + 2), 0x90, 3); + MemSet((LPVOID)(0x5602A6 + 2), 0x90, 3); + + MemPutFast(0xB7C4EC, strength); + return true; +} + +bool CMultiplayerSA::ResetPoleShadowStrength() +{ + BYTE originalMov[4] = {0x66, 0x89, 0x46, 0x4C}; + MemCpy((LPVOID)0x55FCB8, &originalMov, 4); + + BYTE originalCodes[3] = {0xEC, 0xC4, 0xB7}; + MemCpy((LPVOID)(0x56023A + 2), &originalCodes, 3); + MemCpy((LPVOID)(0x5602A6 + 2), &originalCodes, 3); + return true; +} + +int16 CMultiplayerSA::GetShadowStrength() const +{ + return *(int16*)0xB7C4E8; +} + +bool CMultiplayerSA::SetShadowStrength(int16 strength) +{ + MemSet((LPVOID)0x55FC5E, 0x90, 4); + MemSet((LPVOID)(0x56022E + 2), 0x90, 3); + MemSet((LPVOID)(0x560234 + 2), 0x90, 3); + MemSet((LPVOID)(0x56029A + 2), 0x90, 3); + MemSet((LPVOID)(0x5602A0 + 2), 0x90, 3); + + MemPutFast(0xB7C4E8, strength); + return true; +} + +bool CMultiplayerSA::ResetShadowStrength() +{ + BYTE originalMov[4] = {0x66, 0x89, 0x46, 0x48}; + MemCpy((LPVOID)0x55FC5E, &originalMov, 4); + + BYTE originalCodes[3] = {0xE8, 0xC4, 0xB7}; + MemCpy((LPVOID)(0x56022E + 2), &originalCodes, 3); + MemCpy((LPVOID)(0x560234 + 2), &originalCodes, 3); + MemCpy((LPVOID)(0x56029A + 2), &originalCodes, 3); + MemCpy((LPVOID)(0x5602A0 + 2), &originalCodes, 3); + return true; +} + +float CMultiplayerSA::GetShadowsOffset() const +{ + return m_fShadowsOffset; +} + +bool CMultiplayerSA::SetShadowsOffset(float offset) +{ + m_fShadowsOffset = offset; + return true; +} + +bool CMultiplayerSA::ResetShadowsOffset() +{ + m_fShadowsOffset = DEFAULT_SHADOWS_OFFSET; + return true; +} + +float CMultiplayerSA::GetLightsOnGroundBrightness() const +{ + return *(float*)0xB7C4F8; +} + +bool CMultiplayerSA::SetLightsOnGroundBrightness(float brightness) +{ + MemPut(0x55FDBC, 0xDD); + MemPut(0x55FDBD, 0xD8); + MemPut(0x55FDBE, 0x90); + MemSet((LPVOID)(0x5602AC + 2), 0x90, 3); + + MemPutFast(0xB7C4F8, brightness); + return true; +} + +bool CMultiplayerSA::ResetLightsOnGroundBrightness() +{ + BYTE originalFstp[3] = {0xD9, 0x5E, 0x58}; + MemCpy((LPVOID)0x55FDBC, &originalFstp, 3); + + BYTE originalCodes[3] = {0xF8, 0xC4, 0xB7}; + MemCpy((LPVOID)(0x5602AC + 2), &originalCodes, 3); + return true; +} + +void CMultiplayerSA::GetLowCloudsColor(int16& red, int16& green, int16& blue) const +{ + if (bUsingCustomLowCloudsColor) + red = iLowCloudsColorR, green = iLowCloudsColorG, blue = iLowCloudsColorB; + else + red = *(int16*)0xB7C4FC, green = *(int16*)0xB7C4FE, blue = *(int16*)0xB7C500; +} + +bool CMultiplayerSA::SetLowCloudsColor(int16 red, int16 green, int16 blue) +{ + bUsingCustomLowCloudsColor = true; + iLowCloudsColorR = red; + iLowCloudsColorG = green; + iLowCloudsColorB = blue; + return true; +} + +bool CMultiplayerSA::ResetLowCloudsColor() +{ + bUsingCustomLowCloudsColor = false; + return true; +} + +void CMultiplayerSA::GetBottomCloudsColor(int16& red, int16& green, int16& blue) const +{ + if (bUsingCustomBottomCloudsColor) + red = iBottomCloudsColorR, green = iBottomCloudsColorG, blue = iBottomCloudsColorB; + else + red = *(int16*)0xB7C502, green = *(int16*)0xB7C504, blue = *(int16*)0xB7C506; +} + +bool CMultiplayerSA::SetBottomCloudsColor(int16 red, int16 green, int16 blue) +{ + bUsingCustomBottomCloudsColor = true; + iBottomCloudsColorR = red; + iBottomCloudsColorG = green; + iBottomCloudsColorB = blue; + return true; +} + +bool CMultiplayerSA::ResetBottomCloudsColor() +{ + bUsingCustomBottomCloudsColor = false; + return true; +} + +float CMultiplayerSA::GetCloudsAlpha1() const +{ + return *(float*)0xB7C538; +} + +bool CMultiplayerSA::SetCloudsAlpha1(float alpha) +{ + MemPut(0x55FDD5, 0xD8); + MemPutFast(0xB7C538, alpha); + return true; +} + +bool CMultiplayerSA::ResetCloudsAlpha1() +{ + MemPut(0x55FDD5, 0xD9); + return true; +} + +float CMultiplayerSA::GetIllumination() const +{ + return *(float*)0xB7C544; +} + +bool CMultiplayerSA::SetIllumination(float illumination) +{ + MemPut(0x55FE46, 0xD8); + MemPutFast(0xB7C544, illumination); + return true; +} + +bool CMultiplayerSA::ResetIllumination() +{ + MemPut(0x55FE46, 0xD9); + return true; +} + bool CMultiplayerSA::GetExplosionsDisabled() { return m_bExplosionsDisabled; @@ -3563,6 +3898,36 @@ void _cdecl DoEndWorldColorsPokes() MemPutFast(0xB7C4CC, ucSkyGradientBottomG); MemPutFast(0xB7C4CE, ucSkyGradientBottomB); } + if (bUsingCustomAmbientColor) + { + MemPutFast(0xB7C4A0, fAmbientColorR); + MemPutFast(0xB7C4A4, fAmbientColorG); + MemPutFast(0xB7C4A8, fAmbientColorB); + } + if (bUsingCustomAmbientObjectColor) + { + MemPutFast(0xB7C4AC, fAmbientObjectColorR); + MemPutFast(0xB7C4B0, fAmbientObjectColorG); + MemPutFast(0xB7C4B4, fAmbientObjectColorB); + } + if (bUsingCustomDirectionalColor) + { + MemPutFast(0xB7C4B8, fDirectionalColorR); + MemPutFast(0xB7C4BC, fDirectionalColorG); + MemPutFast(0xB7C4C0, fDirectionalColorB); + } + if (bUsingCustomLowCloudsColor) + { + MemPutFast(0xB7C4FC, iLowCloudsColorR); + MemPutFast(0xB7C4FE, iLowCloudsColorG); + MemPutFast(0xB7C500, iLowCloudsColorB); + } + if (bUsingCustomBottomCloudsColor) + { + MemPutFast(0xB7C502, iBottomCloudsColorR); + MemPutFast(0xB7C504, iBottomCloudsColorG); + MemPutFast(0xB7C506, iBottomCloudsColorB); + } if (bUsingCustomWaterColor) { MemPutFast(0xB7C508, fWaterColorR); @@ -6445,22 +6810,74 @@ void _declspec(naked) HOOK_CObject_ProcessCollision() } } +DWORD WindowRespondsToCollision_CalledFrom = 0; void _declspec(naked) HOOK_CGlass_WindowRespondsToCollision() { _asm { - pushad - mov ecx, [esp+4] - mov pDamagedObject, ecx + push eax + mov eax, [esp + 4] + mov WindowRespondsToCollision_CalledFrom, eax + pop eax } - pObjectAttacker = NULL; - if (TriggerObjectBreakEvent()) + if (WindowRespondsToCollision_CalledFrom != CALL_FROM_CGlass_WindowRespondsToExplosion) { _asm { - popad + mov pDamagedObject, esi + } + } + + // Get attacker for the glass break + switch (WindowRespondsToCollision_CalledFrom) + { + case CALL_FROM_CPhysical_ApplyCollision: + case CALL_FROM_CPhysical_ApplyCollision_2: + case CALL_FROM_CPhysical_ApplySoftCollision: + { + _asm + { + mov pObjectAttacker, edi + } + + break; + } + case CALL_FROM_CGlass_WasGlassHitByBullet: + { + _asm + { + mov pObjectAttacker, ebx // WasGlassHitByBullet called from CWeapon::DoBulletImpact + } + + if (!pObjectAttacker || (pObjectAttacker && !pObjectAttacker->m_pRwObject)) // WasGlassHitByBullet called from CBulletInfo::Update + { + _asm + { + push ecx + mov ecx, [edi] + mov pObjectAttacker, ecx + pop ecx + } + } + break; + } + case CALL_FROM_CGlass_WindowRespondsToExplosion: + { + break; + } + default: + pObjectAttacker = nullptr; + } + + if (pObjectAttacker && !pObjectAttacker->m_pRwObject) // Still wrong? + pObjectAttacker = nullptr; + + if (TriggerObjectBreakEvent()) + { + _asm + { sub esp, 68h push esi mov esi, [esp+6Ch+4] @@ -6471,7 +6888,6 @@ void _declspec(naked) HOOK_CGlass_WindowRespondsToCollision() { _asm { - popad retn } } @@ -6484,9 +6900,11 @@ void _declspec(naked) HOOK_CGlass__BreakGlassPhysically() _asm { mov pDamagedObject, esi + push ecx + mov ecx, [esp+4] + mov pObjectAttacker, ecx + pop ecx } - // we can't get attacker from here - pObjectAttacker = NULL; if (TriggerObjectBreakEvent()) { @@ -6512,6 +6930,17 @@ void _declspec(naked) HOOK_CGlass__BreakGlassPhysically() } } +void _declspec(naked) HOOK_CGlass_WindowRespondsToExplosion() +{ + _asm { + push 1 + sub esp, 0Ch + mov pDamagedObject, edx + mov pObjectAttacker, ebp + jmp RETURN_CGlass_WindowRespondsToExplosion + } +} + void* pFxSystemToBeDestroyed; void FxManager_c__DestroyFxSystem() { diff --git a/Client/multiplayer_sa/CMultiplayerSA.h b/Client/multiplayer_sa/CMultiplayerSA.h index 12daeb26be..65a7afb715 100644 --- a/Client/multiplayer_sa/CMultiplayerSA.h +++ b/Client/multiplayer_sa/CMultiplayerSA.h @@ -20,6 +20,7 @@ class CRemoteDataSA; #define DEFAULT_NEAR_CLIP_DISTANCE ( 0.3f ) +#define DEFAULT_SHADOWS_OFFSET ( 0.013f ) // GTA default = 0.06f enum eRadioStationID { @@ -196,6 +197,58 @@ class CMultiplayerSA : public CMultiplayer int GetMoonSize(); void ResetMoonSize(); + void GetAmbientColor(float& red, float& green, float& blue) const; + bool SetAmbientColor(float red, float green, float blue); + bool ResetAmbientColor(); + + void GetAmbientObjectColor(float& red, float& green, float& blue) const; + bool SetAmbientObjectColor(float red, float green, float blue); + bool ResetAmbientObjectColor(); + + void GetDirectionalColor(float& red, float& green, float& blue) const; + bool SetDirectionalColor(float red, float green, float blue); + bool ResetDirectionalColor(); + + float GetSpriteSize() const; + bool SetSpriteSize(float size); + bool ResetSpriteSize(); + + float GetSpriteBrightness() const; + bool SetSpriteBrightness(float brightness); + bool ResetSpriteBrightness(); + + int16 GetPoleShadowStrength() const; + bool SetPoleShadowStrength(int16 strength); + bool ResetPoleShadowStrength(); + + int16 GetShadowStrength() const; + bool SetShadowStrength(int16 strength); + bool ResetShadowStrength(); + + float GetShadowsOffset() const; + bool SetShadowsOffset(float offset); + bool ResetShadowsOffset(); + + float GetLightsOnGroundBrightness() const; + bool SetLightsOnGroundBrightness(float brightness); + bool ResetLightsOnGroundBrightness(); + + void GetLowCloudsColor(int16& red, int16& green, int16& blue) const; + bool SetLowCloudsColor(int16 red, int16 green, int16 blue); + bool ResetLowCloudsColor(); + + void GetBottomCloudsColor(int16& red, int16& green, int16& blue) const; + bool SetBottomCloudsColor(int16 red, int16 green, int16 blue); + bool ResetBottomCloudsColor(); + + float GetCloudsAlpha1() const; + bool SetCloudsAlpha1(float alpha); + bool ResetCloudsAlpha1(); + + float GetIllumination() const; + bool SetIllumination(float illumination); + bool ResetIllumination(); + void SetNightVisionEnabled(bool bEnabled, bool bNoiseEnabled); void SetThermalVisionEnabled(bool bEnabled, bool bNoiseEnabled); bool IsNightVisionEnabled(); diff --git a/Client/multiplayer_sa/CMultiplayerSA_1.3.cpp b/Client/multiplayer_sa/CMultiplayerSA_1.3.cpp index afea015991..fd47e12ba8 100644 --- a/Client/multiplayer_sa/CMultiplayerSA_1.3.cpp +++ b/Client/multiplayer_sa/CMultiplayerSA_1.3.cpp @@ -111,6 +111,9 @@ DWORD RETURN_CProjectile_FixTearGasCrash_Cont = 0x4C0409; #define HOOKPOS_CProjectile_FixExplosionLocation 0x738A77 DWORD RETURN_CProjectile_FixExplosionLocation = 0x738A86; +#define HOOKPOS_CPed_RemoveWeaponWhenEnteringVehicle 0x5E6370 +DWORD RETURN_CPed_RemoveWeaponWhenEnteringVehicle = 0x5E6379; + void HOOK_CVehicle_ProcessStuff_TestSirenTypeSingle(); void HOOK_CVehicle_ProcessStuff_PostPushSirenPositionSingle(); void HOOK_CVehicle_ProcessStuff_TestSirenTypeDual(); @@ -137,6 +140,7 @@ void HOOK_CVehicleModelInterface_SetClump(); void HOOK_CBoat_ApplyDamage(); void HOOK_CProjectile_FixTearGasCrash(); void HOOK_CProjectile_FixExplosionLocation(); +void HOOK_CPed_RemoveWeaponWhenEnteringVehicle(); void CMultiplayerSA::Init_13() { @@ -192,6 +196,9 @@ void CMultiplayerSA::InitHooks_13() HookInstall(HOOKPOS_CProjectile_FixExplosionLocation, (DWORD)HOOK_CProjectile_FixExplosionLocation, 12); + // Fix invisible weapons during jetpack task + HookInstall(HOOKPOS_CPed_RemoveWeaponWhenEnteringVehicle, (DWORD)HOOK_CPed_RemoveWeaponWhenEnteringVehicle, 9); + InitHooks_ClothesSpeedUp(); EnableHooks_ClothesMemFix(true); InitHooks_FixBadAnimId(); @@ -1668,3 +1675,42 @@ void _declspec(naked) HOOK_CProjectile_FixExplosionLocation() jmp RETURN_CProjectile_FixExplosionLocation } } + +DWORD CPed_RemoveWeaponWhenEnteringVehicle_CalledFrom = 0; +void _declspec(naked) HOOK_CPed_RemoveWeaponWhenEnteringVehicle() +{ + _asm + { + push eax + mov eax, [esp+4] + mov CPed_RemoveWeaponWhenEnteringVehicle_CalledFrom, eax + pop eax + + push esi + mov esi, ecx + mov eax, [esi+480h] + } + + // Called from CTaskSimpleJetPack::ProcessPed + if (CPed_RemoveWeaponWhenEnteringVehicle_CalledFrom == 0x68025F) + { + _asm + { + mov pPedUsingJetpack, esi + } + + if (AllowJetPack()) + { + _asm + { + pop esi + retn 4 + } + } + } + + _asm + { + jmp RETURN_CPed_RemoveWeaponWhenEnteringVehicle + } +} diff --git a/Client/multiplayer_sa/CMultiplayerSA_CrashFixHacks.cpp b/Client/multiplayer_sa/CMultiplayerSA_CrashFixHacks.cpp index 583d1c2bd8..0de64aee54 100644 --- a/Client/multiplayer_sa/CMultiplayerSA_CrashFixHacks.cpp +++ b/Client/multiplayer_sa/CMultiplayerSA_CrashFixHacks.cpp @@ -43,6 +43,10 @@ void _declspec(naked) CrashAverted() } } +//////////////////////////////////////////////////////////////////////// +// CCustomCarEnvMapPipeline::CustomPipeRenderCB +// +// Null mesh material pointer //////////////////////////////////////////////////////////////////////// #define HOOKPOS_CrashFix_Misc1 0x5D9A6E #define HOOKSIZE_CrashFix_Misc1 6 @@ -56,7 +60,7 @@ void _declspec(naked) HOOK_CrashFix_Misc1() je cont mov eax,dword ptr ds:[008D12CCh] - mov ecx,dword ptr [eax+esi] // If [eax+esi] is 0, it causes a crash + mov ecx,dword ptr [eax+esi] // If [eax+esi] (mesh->material) is 0, it causes a crash test ecx,ecx jne cont push 1 @@ -67,6 +71,10 @@ void _declspec(naked) HOOK_CrashFix_Misc1() } } +//////////////////////////////////////////////////////////////////////// +// CAutomobile::ProcessControl +// +// Null CColModel pointer or corrupted m_pColData //////////////////////////////////////////////////////////////////////// #define HOOKPOS_CrashFix_Misc2 0x6B18B0 #define HOOKSIZE_CrashFix_Misc2 9 @@ -98,6 +106,10 @@ void _declspec(naked) HOOK_CrashFix_Misc2() } } +//////////////////////////////////////////////////////////////////////// +// CTaskSimpleCarOpenDoorFromOutside::ComputeAnimID +// +// Invalid m_veh pointer //////////////////////////////////////////////////////////////////////// #define HOOKPOS_CrashFix_Misc3 0x645FD9 #define HOOKSIZE_CrashFix_Misc3 6 @@ -107,7 +119,7 @@ void _declspec(naked) HOOK_CrashFix_Misc3() _asm { test ecx,ecx - je cont // Skip much code if ecx is zero (ped has no something) + je cont // Skip much code if ecx is zero (invalid m_veh in CTaskSimpleCarOpenDoorFromOutside) mov edx,dword ptr [ecx+384h] jmp RETURN_CrashFix_Misc3 @@ -118,6 +130,10 @@ void _declspec(naked) HOOK_CrashFix_Misc3() } } +//////////////////////////////////////////////////////////////////////// +// CAESoundManager::Service +// +// Division by 0 //////////////////////////////////////////////////////////////////////// #define HOOKPOS_CrashFix_Misc4 0x4F02D2 #define HOOKSIZE_CrashFix_Misc4 5 @@ -141,6 +157,10 @@ void _declspec(naked) HOOK_CrashFix_Misc4() } } +//////////////////////////////////////////////////////////////////////// +// CPed::SetPedPositionInCar +// +// Null pointer m_pVehicleStruct in the CVehicleModelInfo structure //////////////////////////////////////////////////////////////////////// #define HOOKPOS_CrashFix_Misc5 0x5DF949 #define HOOKSIZE_CrashFix_Misc5 7 @@ -153,7 +173,7 @@ void _declspec(naked) HOOK_CrashFix_Misc5() mov edi, dword ptr [ecx*4+edi] mov edi, dword ptr [edi+5Ch] test edi, edi - je cont // Skip much code if edi is zero (ped has no model) + je cont // Skip much code if edi is zero mov edi, dword ptr[ARRAY_ModelInfo] mov edi, dword ptr [ecx*4+edi] @@ -167,7 +187,12 @@ void _declspec(naked) HOOK_CrashFix_Misc5() } //////////////////////////////////////////////////////////////////////// -// #5465 2/2 +// RpAnimBlend::FrameUpdateCallBackSkinnedWithVelocityExtraction +// +// Mantis #5465 (2/2) (https://web.archive.org/web/20160411120202/http://bugs.mtasa.com/view.php?id=5465) +// +// Null pointer to object in the BlendNodeArrays array of the AnimBlendUpdateData structure +//////////////////////////////////////////////////////////////////////// #define HOOKPOS_CrashFix_Misc6 0x4D1750 #define HOOKSIZE_CrashFix_Misc6 5 DWORD RETURN_CrashFix_Misc6 = 0x4D1755; @@ -190,7 +215,12 @@ void _declspec(naked) HOOK_CrashFix_Misc6() } //////////////////////////////////////////////////////////////////////// -// #5466 +// CCollision::ProcessVerticalLine +// +// Mantis #5466 (https://web.archive.org/web/20160401233418/http://bugs.mtasa.com/view.php?id=5466) +// +// Null colModel pointer +//////////////////////////////////////////////////////////////////////// #define HOOKPOS_CrashFix_Misc7 0x417BF8 #define HOOKSIZE_CrashFix_Misc7 5 DWORD RETURN_CrashFix_Misc7 = 0x417BFD; @@ -213,7 +243,12 @@ void _declspec(naked) HOOK_CrashFix_Misc7() } //////////////////////////////////////////////////////////////////////// -// #5468 1/3 +// Get2DEffectAtomicCallback +// +// Mantis #5468 1/3 (https://web.archive.org/web/20160401233418/http://bugs.mtasa.com/view.php?id=5468) +// +// Null pointer atomic->geometry in the RpAtomic +//////////////////////////////////////////////////////////////////////// #define HOOKPOS_CrashFix_Misc8 0x73485D #define HOOKSIZE_CrashFix_Misc8 5 DWORD RETURN_CrashFix_Misc8 = 0x734862; @@ -236,7 +271,12 @@ void _declspec(naked) HOOK_CrashFix_Misc8() } //////////////////////////////////////////////////////////////////////// -// #5468 2/3 +// CProjectileInfo::Update +// +// Mantis #5468 2/3 (https://web.archive.org/web/20160401233418/http://bugs.mtasa.com/view.php?id=5468) +// +// Null pointer projectile of type CObject* in the array CProjectileInfo::ms_apProjectile +//////////////////////////////////////////////////////////////////////// #define HOOKPOS_CrashFix_Misc9 0x738B64 #define HOOKSIZE_CrashFix_Misc9 6 DWORD RETURN_CrashFix_Misc9 = 0x738B6A; @@ -259,7 +299,12 @@ void _declspec(naked) HOOK_CrashFix_Misc9() } //////////////////////////////////////////////////////////////////////// -// #5468 3/3 +// CEntity::TransformFromObjectSpace +// +// Mantis #5468 3/3 (https://web.archive.org/web/20160401233418/http://bugs.mtasa.com/view.php?id=5468) +// +// Invalid pointer to a vector +//////////////////////////////////////////////////////////////////////// #define HOOKPOS_CrashFix_Misc10 0x5334FE #define HOOKSIZE_CrashFix_Misc10 6 DWORD RETURN_CrashFix_Misc10 = 0x533504; @@ -286,7 +331,12 @@ void _declspec(naked) HOOK_CrashFix_Misc10() } //////////////////////////////////////////////////////////////////////// -// #5576 +// RpAnimBlend::FrameUpdateCallBackSkinned +// +// Mantis #5576 (https://web.archive.org/web/20160408163600/http://bugs.mtasa.com/view.php?id=5576) +// +// The crash likely occurs due to invalid data passed as the second argument +//////////////////////////////////////////////////////////////////////// #define HOOKPOS_CrashFix_Misc11 0x4D2C62 #define HOOKSIZE_CrashFix_Misc11 5 DWORD RETURN_CrashFix_Misc11 = 0x4D2C67; @@ -309,7 +359,12 @@ void _declspec(naked) HOOK_CrashFix_Misc11() } //////////////////////////////////////////////////////////////////////// -// #5530 +// CAnimManager::UncompressAnimation +// +// Mantis #5530 (https://web.archive.org/web/20160411114105/http://bugs.mtasa.com/view.php?id=5530) +// +// Null pointer of type CAnimBlendHierarchy passed to the function +//////////////////////////////////////////////////////////////////////// #define HOOKPOS_CrashFix_Misc12 0x4D41C5 #define HOOKSIZE_CrashFix_Misc12 5 DWORD RETURN_CrashFix_Misc12 = 0x4D41CA; @@ -331,6 +386,10 @@ void _declspec(naked) HOOK_CrashFix_Misc12() } } +//////////////////////////////////////////////////////////////////////// +// CAnimManager::BlendAnimation +// +// Invalid animation (Null pointer returned by CAnimBlendAssocGroup::GetAnimation) //////////////////////////////////////////////////////////////////////// #define HOOKPOS_CrashFix_Misc13 0x4D464E #define HOOKSIZE_CrashFix_Misc13 6 @@ -353,6 +412,10 @@ void _declspec(naked) HOOK_CrashFix_Misc13() } } +//////////////////////////////////////////////////////////////////////// +// CAEFrontendAudioEntity::AddAudioEvent +// +// Invalid pointer to the array CAEAudioEntity::m_pAudioEventVolumes //////////////////////////////////////////////////////////////////////// #define HOOKPOS_CrashFix_Misc14 0x4DD4B5 #define HOOKSIZE_CrashFix_Misc14 6 @@ -420,7 +483,10 @@ void _declspec(naked) HOOK_FreezeFix_Misc15() } //////////////////////////////////////////////////////////////////////// -// Handle RpAnimBlendClumpGetFirstAssociation returning NULL +// CPed::PlayFootSteps +// +// RpAnimBlendClumpGetFirstAssociation returns null pointer +//////////////////////////////////////////////////////////////////////// #define HOOKPOS_CrashFix_Misc16 0x5E5815 #define HOOKSIZE_CrashFix_Misc16 6 DWORD RETURN_CrashFix_Misc16 = 0x5E581B; @@ -445,7 +511,10 @@ void _declspec(naked) HOOK_CrashFix_Misc16() } //////////////////////////////////////////////////////////////////////// -// Handle RwFrameSetStaticPluginsSize having NULL member at 0x90 +// RwFrameForAllObjects +// +// Null pointer for the objectList (0x90) field of the RwFrame structure +//////////////////////////////////////////////////////////////////////// #define HOOKPOS_CrashFix_Misc17 0x7F120E #define HOOKSIZE_CrashFix_Misc17 6 DWORD RETURN_CrashFix_Misc17 = 0x7F1214; @@ -469,7 +538,10 @@ void _declspec(naked) HOOK_CrashFix_Misc17() } //////////////////////////////////////////////////////////////////////// -// Handle GetWheelPosition having wrong data +// CVehicleModelInfo::GetWheelPosn +// +// Null pointer frame returned by CClumpModelInfo::GetFrameFromId +//////////////////////////////////////////////////////////////////////// #define HOOKPOS_CrashFix_Misc18 0x4C7DAD #define HOOKSIZE_CrashFix_Misc18 7 DWORD RETURN_CrashFix_Misc18 = 0x4C7DB4; @@ -500,7 +572,10 @@ void _declspec(naked) HOOK_CrashFix_Misc18() } //////////////////////////////////////////////////////////////////////// -// Handle RwFrameCloneHierarchy having wrong data +// RwFrameAddChild +// +// The pointer passed as the first argument of type RwFrame to the function is null +//////////////////////////////////////////////////////////////////////// #define HOOKPOS_CrashFix_Misc19 0x7F0BF7 #define HOOKSIZE_CrashFix_Misc19 6 DWORD RETURN_CrashFix_Misc19 = 0x7F0BFD; @@ -526,7 +601,10 @@ void _declspec(naked) HOOK_CrashFix_Misc19() } //////////////////////////////////////////////////////////////////////// -// Handle CPlaceable::RemoveMatrix having wrong data +// CPlaceable::RemoveMatrix +// +// "this" is invalid +//////////////////////////////////////////////////////////////////////// #define HOOKPOS_CrashFix_Misc20 0x54F3B0 #define HOOKSIZE_CrashFix_Misc20 6 DWORD RETURN_CrashFix_Misc20 = 0x54F3B6; @@ -549,12 +627,11 @@ void _declspec(naked) HOOK_CrashFix_Misc20() } } -////////////////////////////////////////////////////////////////////////////////////////// -// +//////////////////////////////////////////////////////////////////////// +// CTaskSimpleCarFallOut::FinishAnimFallOutCB +// // Handle CTaskSimpleCarFallOut::FinishAnimFallOutCB having wrong data -// -// -////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////// bool IsTaskSimpleCarFallOutValid(CAnimBlendAssociationSAInterface* pAnimBlendAssociation, CTaskSimpleCarFallOutSAInterface* pTask) { if (pTask->VTBL != (TaskVTBL*)VTBL_CTaskSimpleCarFallOut) @@ -608,7 +685,10 @@ void _declspec(naked) HOOK_CrashFix_Misc21() } //////////////////////////////////////////////////////////////////////// -// Handle CAnimBlendAssociation::Init having wrong data +// CAnimBlendAssociation::Init +// +// this->m_clumpAssoc.m_pNodeArray[v5] is invalid +//////////////////////////////////////////////////////////////////////// #define HOOKPOS_CrashFix_Misc22 0x4CEF08 #define HOOKSIZE_CrashFix_Misc22 6 DWORD RETURN_CrashFix_Misc22 = 0x4CEF25; @@ -654,7 +734,10 @@ void _declspec(naked) HOOK_CrashFix_Misc22() } //////////////////////////////////////////////////////////////////////// -// Handle CVehicleAnimGroup::ComputeAnimDoorOffsets having wrong door index +// CVehicleAnimGroup::ComputeAnimDoorOffsets +// +// Door index is out of range +//////////////////////////////////////////////////////////////////////// #define HOOKPOS_CrashFix_Misc23 0x6E3D10 #define HOOKSIZE_CrashFix_Misc23 7 DWORD RETURN_CrashFix_Misc23 = 0x6E3D17; @@ -682,7 +765,10 @@ void _declspec(naked) HOOK_CrashFix_Misc23() } //////////////////////////////////////////////////////////////////////// -// Handle _RwFrameForAllChildren being called with NULL +// RwFrameForAllChildren +// +// The first argument of type RwFrame received is invalid +//////////////////////////////////////////////////////////////////////// #define HOOKPOS_CrashFix_Misc24 0x7F0DC8 #define HOOKSIZE_CrashFix_Misc24 6 DWORD RETURN_CrashFix_Misc24 = 0x7F0DCE; @@ -707,7 +793,10 @@ void _declspec(naked) HOOK_CrashFix_Misc24() } //////////////////////////////////////////////////////////////////////// -// Handle CTaskSimpleCarOpenDoorFromOutside::FinishAnimCarOpenDoorFromOutsideCB having zero pointer to vehicle +// CTaskSimpleCarOpenDoorFromOutside::FinishAnimCarOpenDoorFromOutsideCB +// +// Null vehicle pointer +//////////////////////////////////////////////////////////////////////// #define HOOKPOS_CrashFix_Misc25 0x646026 #define HOOKSIZE_CrashFix_Misc25 5 DWORD RETURN_CrashFix_Misc25 = 0x64602B; @@ -736,7 +825,10 @@ void _declspec(naked) HOOK_CrashFix_Misc25() } //////////////////////////////////////////////////////////////////////// -// Handle CShotInfo::Update having invalid item +// CShotInfo::Update +// +// _creator->m_pIntelligence is invalid +//////////////////////////////////////////////////////////////////////// #define HOOKPOS_CrashFix_Misc26 0x739FA0 #define HOOKSIZE_CrashFix_Misc26 6 DWORD RETURN_CrashFix_Misc26 = 0x739FA6; @@ -766,7 +858,10 @@ void _declspec(naked) HOOK_CrashFix_Misc26() } //////////////////////////////////////////////////////////////////////// -// Handle CTaskComplexDieInCar::ControlSubTask ped with no vehicle +// CTaskComplexDieInCar::ControlSubTask +// +// ped or ped->m_pVehicle is null pointer +//////////////////////////////////////////////////////////////////////// #define HOOKPOS_CrashFix_Misc27 0x6377FB #define HOOKSIZE_CrashFix_Misc27 7 DWORD RETURN_CrashFix_Misc27 = 0x637802; @@ -792,7 +887,10 @@ void _declspec(naked) HOOK_CrashFix_Misc27() } //////////////////////////////////////////////////////////////////////// -// Handle CObject::ProcessGarageDoorBehaviour object with no dummy +// CObject::ProcessGarageDoorBehaviour +// +// Null this->m_pDummyObject pointer +//////////////////////////////////////////////////////////////////////// #define HOOKPOS_CrashFix_Misc28 0x44A4FD #define HOOKSIZE_CrashFix_Misc28 6 DWORD RETURN_CrashFix_Misc28 = 0x44A503; @@ -820,7 +918,10 @@ void _declspec(naked) HOOK_CrashFix_Misc28() } //////////////////////////////////////////////////////////////////////// -// Handle CAEPCBankLoader::IsSoundBankLoaded with invalid argument +// CAEMP3BankLoader::IsSoundBankLoaded +// +// The value of the argument BankSlotId is invalid +//////////////////////////////////////////////////////////////////////// #define HOOKPOS_CrashFix_Misc29 0x4E022C #define HOOKSIZE_CrashFix_Misc29 5 DWORD RETURN_CrashFix_Misc29 = 0x4E0231; @@ -848,7 +949,10 @@ void _declspec(naked) HOOK_CrashFix_Misc29() } //////////////////////////////////////////////////////////////////////// -// Handle CAnimBlendAssociation::SetFinishCallback with invalid ecx +// CAnimBlendAssociation::SetFinishCallback +// +// "this" is invalid +//////////////////////////////////////////////////////////////////////// #define HOOKPOS_CrashFix_Misc30 0x4CEBE8 #define HOOKSIZE_CrashFix_Misc30 7 #define HOOKCHECK_CrashFix_Misc30 0xC7 @@ -875,11 +979,11 @@ void _declspec(naked) HOOK_CrashFix_Misc30() } } -////////////////////////////////////////////////////////////////////////////////////////// -// +//////////////////////////////////////////////////////////////////////// // CClumpModelInfo::GetFrameFromId // -////////////////////////////////////////////////////////////////////////////////////////// +// Invalid frame +//////////////////////////////////////////////////////////////////////// RwFrame* OnMY_CClumpModelInfo_GetFrameFromId_Post(RwFrame* pFrameResult, DWORD _ebx, DWORD _esi, DWORD _edi, DWORD calledFrom, RpClump* pClump, int id) { if (pFrameResult) @@ -989,13 +1093,11 @@ CStreamingInfo* GetStreamingInfo(uint id) return pItemInfo + id; } -////////////////////////////////////////////////////////////////////////////////////////// -// +//////////////////////////////////////////////////////////////////////// // CEntity::GetBoundRect // -// Check if crash will occur -// -////////////////////////////////////////////////////////////////////////////////////////// +// modelInfo->m_pColModel is a null pointer +//////////////////////////////////////////////////////////////////////// void OnMY_CEntity_GetBoundRect(CEntitySAInterface* pEntity) { uint32 usModelId = pEntity->m_nModelIndex; @@ -1050,13 +1152,11 @@ void _declspec(naked) HOOK_CEntity_GetBoundRect() } } -////////////////////////////////////////////////////////////////////////////////////////// -// +////////////////////////////////////////////////////////////////////////// // CVehicle_AddUpgrade // // Record some variables in case crash occurs -// -////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////// void OnMY_CVehicle_AddUpgrade_Pre(CVehicleSAInterface* pVehicle, int iUpgradeId, int iFrame) { CArgMap argMap; @@ -1104,11 +1204,11 @@ void _declspec(naked) HOOK_CVehicle_AddUpgrade() } } -////////////////////////////////////////////////////////////////////////////////////////// -// +//////////////////////////////////////////////////////////////////////// +// CObject::~CObject, CObject::ProcessTrainCrossingBehavior +// // Train crossings: Detach barrier from post (to be able to create objects 1373 and 1374 separately) -// -////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////// #define HOOKPOS_CObject_Destructor_TrainCrossing_Check 0x59F7A8 #define HOOKPOS_CObject_ProcessTrainCrossingBehavior1 0x5A0C34 #define HOOKPOS_CObject_ProcessTrainCrossingBehavior2 0x5A0C54 @@ -1139,11 +1239,11 @@ void _declspec(naked) HOOK_TrainCrossingBarrierCrashFix() } } -////////////////////////////////////////////////////////////////////////////////////////// -// +//////////////////////////////////////////////////////////////////////// +// Interior_c::Init +// // GTA doesn't reset the furniture object counter, so do it manually everytime before GTA furnishes an interior (Interior_c::Init) -// -////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////// #define HOOKPOS_ResetFurnitureObjectCounter 0x593BF0 #define HOOKSIZE_ResetFurnitureObjectCounter 6 DWORD RETURN_ResetFurnitureObjectCounter = 0x593BF6; @@ -1159,14 +1259,12 @@ void _declspec(naked) HOOK_ResetFurnitureObjectCounter() } } -////////////////////////////////////////////////////////////////////////////////////////// -// +//////////////////////////////////////////////////////////////////////// // CVolumetricShadowMgr_Render -// +// // Custom models can cause problems for volumetric shadows. // Record when volumetric shadows are being rendered so we can disable them if a crash occurs. -// -////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////// void OnMY_CVolumetricShadowMgr_Render_Pre() { OnEnterCrashZone(1); @@ -1205,14 +1303,12 @@ void _declspec(naked) HOOK_CVolumetricShadowMgr_Render() } } -////////////////////////////////////////////////////////////////////////////////////////// -// +//////////////////////////////////////////////////////////////////////// // CVolumetricShadowMgr_Update -// +// // Custom models can cause problems for volumetric shadows. // Record when volumetric shadows are being updated so we can disable them if a crash occurs. -// -////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////// void OnMY_CVolumetricShadowMgr_Update_Pre() { OnEnterCrashZone(2); @@ -1252,13 +1348,11 @@ void _declspec(naked) HOOK_CVolumetricShadowMgr_Update() } } -////////////////////////////////////////////////////////////////////////////////////////// -// -// CAnimManager_CreateAnimAssocGroups -// -// A model (usually 7) has to be loaded to avoid a crash -// -////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////// +// CAnimManager::CreateAnimAssocGroups +// +// CModelInfo::ms_modelInfoPtrs at the given index is a null pointer +//////////////////////////////////////////////////////////////////////// void OnMY_CAnimManager_CreateAnimAssocGroups(uint uiModelId) { CModelInfo* pModelInfo = pGameInterface->GetModelInfo(uiModelId); @@ -1298,14 +1392,12 @@ void _declspec(naked) HOOK_CAnimManager_CreateAnimAssocGroups() } } -////////////////////////////////////////////////////////////////////////////////////////// -// -// Something called from CTaskComplexCarSlowBeDraggedOut_CreateFirstSubTask +//////////////////////////////////////////////////////////////////////// +// CTaskComplexCarSlowBeDraggedOut::CreateFirstSubTask // // Accessing a temporally not existing vehicle // (seems to happen when the driver is slower being thrown out than the jacker enters the vehicle) -// -////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////// #define HOOKPOS_CTaskComplexCarSlowBeDraggedOut_CreateFirstSubTask 0x6485AC #define HOOKSIZE_CTaskComplexCarSlowBeDraggedOut_CreateFirstSubTask 6 DWORD RETURN_CTaskComplexCarSlowBeDraggedOut_CreateFirstSubTask = 0x6485B2; @@ -1334,11 +1426,9 @@ void _declspec(naked) HOOK_CTaskComplexCarSlowBeDraggedOut_CreateFirstSubTask() } //////////////////////////////////////////////////////////////////////// -// // OnMY_printf -// +// // GTA outputs stuff via printf which we can use to help diagnose problems -// //////////////////////////////////////////////////////////////////////// void _cdecl OnMY_printf(DWORD dwCalledFrom, const char* szMessage) { @@ -1393,11 +1483,9 @@ void _declspec(naked) HOOK_printf() } //////////////////////////////////////////////////////////////////////// -// // RwMatrixMultiply -// -// Check for invalid matix pointer -// +// +// The third received argument of type RwMatrixTag* is a null pointer //////////////////////////////////////////////////////////////////////// #define HOOKPOS_RwMatrixMultiply 0x7F18B0 #define HOOKSIZE_RwMatrixMultiply 6 @@ -1421,13 +1509,11 @@ void _declspec(naked) HOOK_RwMatrixMultiply() } } -////////////////////////////////////////////////////////////////////////////////////////// -// -// CAnimBlendNode_GetCurrentTranslation -// -// Check for corrupt endKeyFrameIndex -// -////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////// +// CAnimBlendNode::GetCurrentTranslation +// +// Invalid endKeyFrameIndex +//////////////////////////////////////////////////////////////////////// void OnMY_CAnimBlendNode_GetCurrentTranslation(CAnimBlendNodeSAInterface* pInterface) { // Crash will occur at offset 0xCFCD6 @@ -1490,14 +1576,12 @@ void _declspec(naked) HOOK_CAnimBlendNode_GetCurrentTranslation() } } -////////////////////////////////////////////////////////////////////////////////////////// -// -// CStreaming_AreAnimsUsedByRequestedModels -// +//////////////////////////////////////////////////////////////////////// +// CStreaming::AreAnimsUsedByRequestedModels +// // GTA streamer will use this function to decide if IFP blocks should be unloaded or not. // We will return true to disable unloading. -// -////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////// bool __cdecl OnMY_CStreaming_AreAnimsUsedByRequestedModels(int modelID) { // GTA SA possibly cannot have more than 200 IFP blocks since that's the limit @@ -1529,17 +1613,16 @@ void _declspec(naked) HOOK_CStreaming_AreAnimsUsedByRequestedModels() } } -////////////////////////////////////////////////////////////////////////////////////////// -// +//////////////////////////////////////////////////////////////////////// // CTrain::ProcessControl -// +// // This hook overwrites the logic to wrap the train's rail distance, because in the // original game code this could cause an infinite loop // -////////////////////////////////////////////////////////////////////////////////////////// // 0x6F8F83 | 88 9E CA 05 00 00 | mov [esi + 5CAh], bl // >>> 0x6F8F89 | D9 86 A8 05 00 00 | fld dword ptr [esi + 5A8h] // 0x6F8F8F | D8 1D 50 8B 85 00 | fcomp ds: __real @00000000 +//////////////////////////////////////////////////////////////////////// #define HOOKPOS_CTrain__ProcessControl 0x6F8F89 #define HOOKSIZE_CTrain__ProcessControl 6 static DWORD CONTINUE_CTrain__ProcessControl = 0x6F8FE5; @@ -1597,17 +1680,16 @@ static void _declspec(naked) HOOK_CTrain__ProcessControl() } } -////////////////////////////////////////////////////////////////////////////////////////// -// +//////////////////////////////////////////////////////////////////////// // CTaskComplexCarSlowBeDraggedOutAndStandUp::CreateFirstSubTask -// +// // This hook adds a null-pointer check for eax, which stores the ped's current vehicle. // Returning a null-pointer from this function will prevent the animation from being played. // -////////////////////////////////////////////////////////////////////////////////////////// // 0x648AAC | C2 04 00 | retn 4 // >>> 0x648AAF | 8B 80 84 03 00 00 | mov eax, [eax + 384h] // 0x648AB5 | 0F B6 80 DE 00 00 00 | movzx eax, byte ptr [eax + 0DEh] +//////////////////////////////////////////////////////////////////////// #define HOOKPOS_CTaskComplexCarSlowBeDraggedOutAndStandUp__CreateFirstSubTask 0x648AAF #define HOOKSIZE_CTaskComplexCarSlowBeDraggedOutAndStandUp__CreateFirstSubTask 6 static DWORD CONTINUE_CTaskComplexCarSlowBeDraggedOutAndStandUp__CreateFirstSubTask = 0x648AB5; @@ -1636,16 +1718,14 @@ static void _declspec(naked) HOOK_CTaskComplexCarSlowBeDraggedOutAndStandUp__Cre } } -////////////////////////////////////////////////////////////////////////////////////////// -// +//////////////////////////////////////////////////////////////////////// // CVehicleModelInfo::LoadVehicleColours -// +// // A modified data/carcols.dat can have entries with invalid model names and these cause // CModelInfo::GetModelInfo to return a null pointer, but the original code doesn't verify // the return value and tries to use the null pointer. This hook adds a null pointer check // and then skips the line if in the null case. There are two locations to hook. -// -////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////// static void _cdecl LOG_CVehicleModelInfo__LoadVehicleColours(int location, const char* modelName) { LogEvent(820 + location, "CVehicleModelInfo::LoadVehicleColours", "Could not find model by name:", modelName); @@ -1719,17 +1799,16 @@ static void _declspec(naked) HOOK_CVehicleModelInfo__LoadVehicleColours_2() } } -////////////////////////////////////////////////////////////////////////////////////////// -// +//////////////////////////////////////////////////////////////////////// // CPlaceName::Process -// +// // Prevent the original game code from accessing the ped's vehicle, when it's a null pointer // and the ped flag bInVehicle is set by setting the ped flag to zero. // -////////////////////////////////////////////////////////////////////////////////////////// // 0x571F37 | 8B F1 | mov esi, ecx // >>> 0x571F39 | 8B 88 6C 04 00 00 | mov ecx, [eax + 46Ch] // 0x571F3F | F6 C5 01 | test ch, 1 +//////////////////////////////////////////////////////////////////////// #define HOOKPOS_CPlaceName__Process 0x571F39 #define HOOKSIZE_CPlaceName__Process 6 static DWORD CONTINUE_CPlaceName__Process = 0x571F3F; @@ -1755,6 +1834,11 @@ static void _declspec(naked) HOOK_CPlaceName__Process() } } +//////////////////////////////////////////////////////////////////////// +// CWorld::FindObjectsKindaCollidingSectorList +// +// A null pointer at the given index in CModelInfo::ms_modelInfoPtrs or a null pointer in the m_pColModel field +//////////////////////////////////////////////////////////////////////// static void LOG_CWorld__FindObjectsKindaCollidingSectorList(unsigned int modelId) { CBaseModelInfoSAInterface* pModelInfo = ((CBaseModelInfoSAInterface**)ARRAY_ModelInfo)[modelId]; @@ -1798,17 +1882,16 @@ static void _declspec(naked) HOOK_CWorld__FindObjectsKindaCollidingSectorList() } } -////////////////////////////////////////////////////////////////////////////////////////// -// +//////////////////////////////////////////////////////////////////////// // RpClumpForAllAtomics -// +// // Adds a nullptr check for the clump object pointer. // -////////////////////////////////////////////////////////////////////////////////////////// // >>> 0x749B70 | 8B 44 24 04 | mov eax, [esp+arg_0] // >>> 0x749B74 | 53 | push ebx // >>> 0x749B75 | 55 | push ebp // 0x749B76 | 56 | push esi +//////////////////////////////////////////////////////////////////////// #define HOOKPOS_RpClumpForAllAtomics 0x749B70 #define HOOKSIZE_RpClumpForAllAtomics 6 static DWORD CONTINUE_RpClumpForAllAtomics = 0x749B76; @@ -1829,15 +1912,14 @@ static void _declspec(naked) HOOK_RpClumpForAllAtomics() } } -////////////////////////////////////////////////////////////////////////////////////////// -// +//////////////////////////////////////////////////////////////////////// // RpAnimBlendClumpGetFirstAssociation -// +// // Adds a nullptr check for the clump object pointer. // -////////////////////////////////////////////////////////////////////////////////////////// // >>> 0x4D6A70 | 8B 0D 78 F8 B5 00 | mov ecx, ds:_ClumpOffset // 0x4D6A76 | 8B 44 24 04 | mov eax, [esp+4] +//////////////////////////////////////////////////////////////////////// #define HOOKPOS_RpAnimBlendClumpGetFirstAssociation 0x4D6A70 #define HOOKSIZE_RpAnimBlendClumpGetFirstAssociation 6 static DWORD CONTINUE_RpAnimBlendClumpGetFirstAssociation = 0x4D6A76; @@ -1857,16 +1939,15 @@ static void _declspec(naked) HOOK_RpAnimBlendClumpGetFirstAssociation() } } -////////////////////////////////////////////////////////////////////////////////////////// -// +//////////////////////////////////////////////////////////////////////// // CAnimManager::BlendAnimation -// +// // Adds a nullptr check for the clump object pointer. // -////////////////////////////////////////////////////////////////////////////////////////// // >>> 0x4D4610 | 83 EC 14 | sub esp, 14h // >>> 0x4D4613 | 8B 4C 24 18 | mov ecx, [esp+18h] // 0x4D4617 | 8B 15 34 EA B4 00 | mov edx, CAnimManager::ms_aAnimAssocGroups +//////////////////////////////////////////////////////////////////////// #define HOOKPOS_CAnimManager__BlendAnimation 0x4D4610 #define HOOKSIZE_CAnimManager__BlendAnimation 7 static DWORD CONTINUE_CAnimManager__BlendAnimation = 0x4D4617; @@ -1887,14 +1968,12 @@ static void _declspec(naked) HOOK_CAnimManager__BlendAnimation() } } -////////////////////////////////////////////////////////////////////////////////////////// -// +//////////////////////////////////////////////////////////////////////// // FxSystemBP_c::Load // // Remove every FxEmitter without a main texture because the game logic expects AT LEAST // one texture at index 0 ("main texture"). // -////////////////////////////////////////////////////////////////////////////////////////// // 0x5C0A14 | 5E | pop esi // >>> 0x5C0A15 | 5D | pop ebp // >>> 0x5C0A16 | 32 C0 | xor al, al @@ -1902,6 +1981,7 @@ static void _declspec(naked) HOOK_CAnimManager__BlendAnimation() // >>> 0x5C0A19 | 64 89 0D 00 00 00 00 | mov large fs:0, ecx // >>> 0x5C0A20 | 81 C4 E8 05 00 00 | add esp, 5E8h // >>> 0x5C0A26 | C2 0C 00 | retn 0Ch +//////////////////////////////////////////////////////////////////////// #define HOOKPOS_FxSystemBP_c__Load 0x5C0A15 #define HOOKSIZE_FxSystemBP_c__Load 19 @@ -1954,17 +2034,16 @@ static void _declspec(naked) HOOK_FxSystemBP_c__Load() } } -////////////////////////////////////////////////////////////////////////////////////////// -// +//////////////////////////////////////////////////////////////////////// // FxPrim_c::Enable // // Add a null-pointer check for the ecx pointer. This hook is a side-effect of the hook for // FxSystemBP_c::Load above. // -////////////////////////////////////////////////////////////////////////////////////////// // >>> 0x4A9F50 | 8A 44 24 04 | mov al, [esp+4] // >>> 0x4A9F54 | 88 41 0C | mov [ecx+0xC], al // >>> 0x4A9F57 | C2 04 00 | retn 4 +//////////////////////////////////////////////////////////////////////// #define HOOKPOS_FxPrim_c__Enable 0x4A9F50 #define HOOKSIZE_FxPrim_c__Enable 10 @@ -1982,11 +2061,43 @@ static void _declspec(naked) HOOK_FxPrim_c__Enable() } } +//////////////////////////////////////////////////////////////////////// +// CFire::ProcessFire +// +// GitHub #1757 (https://github.com/multitheftauto/mtasa-blue/issues/1757) +// +// Null pointer to the attachedTo field in the CFire structure +//////////////////////////////////////////////////////////////////////// +#define HOOKPOS_CFire_ProcessFire 0x53A6FC +#define HOOKSIZE_CFire_ProcessFire 9 +static DWORD CONTINUE_CFire_ProcessFire = 0x53A705; +static void _declspec(naked) HOOK_CFire_ProcessFire() +{ + _asm + { + test byte ptr [esi], 4 + // If the beingExtinguished flag has been set, we skip processing this fire instance + jnz skip + + mov ecx, [esi+10h] + mov eax, [ecx+590h] + jmp CONTINUE_CFire_ProcessFire + + skip: + pop edi + pop esi + pop ebp + pop ebx + add esp, 2Ch + retn + } +} + ////////////////////////////////////////////////////////////////////////////////////////// // // Setup hooks for CrashFixHacks // -////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////// void CMultiplayerSA::InitHooks_CrashFixHacks() { EZHookInstall(CrashFix_Misc1); @@ -2042,6 +2153,7 @@ void CMultiplayerSA::InitHooks_CrashFixHacks() EZHookInstall(CAnimManager__BlendAnimation); EZHookInstall(FxSystemBP_c__Load); EZHookInstall(FxPrim_c__Enable); + EZHookInstall(CFire_ProcessFire); // Install train crossing crashfix (the temporary variable is required for the template logic) void (*temp)() = HOOK_TrainCrossingBarrierCrashFix; diff --git a/Client/sdk/game/CAnimManager.h b/Client/sdk/game/CAnimManager.h index c78c2268a4..31e4c88e00 100644 --- a/Client/sdk/game/CAnimManager.h +++ b/Client/sdk/game/CAnimManager.h @@ -1,11 +1,11 @@ /***************************************************************************** * - * PROJECT: Multi Theft Auto v1.0 + * PROJECT: Multi Theft Auto * LICENSE: See LICENSE in the top level directory - * FILE: sdk/game/CAnimManager.h + * FILE: Client/sdk/game/CAnimManager.h * PURPOSE: Animation manager interface * - * Multi Theft Auto is available from http://www.multitheftauto.com/ + * Multi Theft Auto is available from https://multitheftauto.com/ * *****************************************************************************/ @@ -66,14 +66,14 @@ class CAnimManager virtual int GetAnimationBlockIndex(const char* szName) = 0; virtual int RegisterAnimBlock(const char* szName) = 0; - virtual AnimAssocGroup_type GetAnimBlendAssoc(AssocGroupId groupID) = 0; + virtual AnimAssocGroup_type GetAnimBlendAssoc(AssocGroupId groupID) const = 0; virtual AssocGroupId GetFirstAssocGroup(const char* szName) = 0; virtual const char* GetAnimGroupName(AssocGroupId groupID) = 0; virtual const char* GetAnimBlockName(AssocGroupId groupID) = 0; virtual AnimBlendAssoc_type CreateAnimAssociation(AssocGroupId animGroup, AnimationId animID) = 0; - virtual StaticAssocIntface_type GetAnimStaticAssociation(eAnimGroup animGroup, eAnimID animID) = 0; + virtual StaticAssocIntface_type GetAnimStaticAssociation(eAnimGroup animGroup, eAnimID animID) const = 0; virtual AnimBlendAssoc_type GetAnimAssociation(AssocGroupId animGroup, const char* szAnimName) = 0; virtual AnimBlendAssoc_type AddAnimation(RpClump* pClump, AssocGroupId animGroup, AnimationId animID) = 0; virtual AnimBlendAssoc_type AddAnimation(RpClump* pClump, CAnimBlendHierarchy*, int ID) = 0; @@ -128,7 +128,10 @@ class CAnimManager virtual void DeleteCustomAnimHierarchyInterface(CAnimBlendHierarchySAInterface* pInterface) = 0; virtual void DeleteCustomAnimSequenceInterface(CAnimBlendSequenceSAInterface* pInterface) = 0; - virtual bool isGateWayAnimationHierarchy(CAnimBlendHierarchySAInterface* pInterface) = 0; - virtual const SString& GetGateWayBlockName() = 0; - virtual const SString& GetGateWayAnimationName() = 0; + virtual bool isGateWayAnimationHierarchy(CAnimBlendHierarchySAInterface* pInterface) = 0; + virtual const char* GetGateWayBlockName() const = 0; + virtual const char* GetGateWayAnimationName() const = 0; + + virtual bool IsValidGroup(std::uint32_t uiAnimGroup) const = 0; + virtual bool IsValidAnim(std::uint32_t uiAnimGroup, std::uint32_t uiAnimID) const = 0; }; diff --git a/Client/sdk/game/CCheckpoint.h b/Client/sdk/game/CCheckpoint.h index 66e5e0c371..ce17f92267 100644 --- a/Client/sdk/game/CCheckpoint.h +++ b/Client/sdk/game/CCheckpoint.h @@ -52,4 +52,7 @@ class CCheckpoint virtual void SetCameraRange(float fCameraRange) = 0; virtual float GetPulseFraction() = 0; virtual void Remove() = 0; + virtual SColor GetTargetArrowColor() const noexcept = 0; + virtual float GetTargetArrowSize() const noexcept = 0; + virtual void SetTargetArrowData(const SColor arrowColo, float size) noexcept = 0; }; diff --git a/Client/sdk/game/CCheckpoints.h b/Client/sdk/game/CCheckpoints.h index 7917827339..be9c803a40 100644 --- a/Client/sdk/game/CCheckpoints.h +++ b/Client/sdk/game/CCheckpoints.h @@ -20,4 +20,5 @@ class CCheckpoints virtual CCheckpoint* CreateCheckpoint(DWORD Identifier, WORD wType, CVector* vecPosition, CVector* vecPointDir, float fSize, float fPulseFraction, const SharedUtil::SColor color) = 0; virtual CCheckpoint* FindFreeMarker() = 0; + virtual CCheckpoint* FindMarker(DWORD identifier) = 0; }; diff --git a/Client/sdk/game/CGame.h b/Client/sdk/game/CGame.h index c529609ee5..215141ee23 100644 --- a/Client/sdk/game/CGame.h +++ b/Client/sdk/game/CGame.h @@ -225,6 +225,9 @@ class __declspec(novtable) CGame virtual bool IsRoadSignsTextEnabled() const noexcept = 0; virtual void SetRoadSignsTextEnabled(bool isEnabled) = 0; + virtual bool IsTunnelWeatherBlendEnabled() const noexcept = 0; + virtual void SetTunnelWeatherBlendEnabled(bool isEnabled) = 0; + virtual CWeapon* CreateWeapon() = 0; virtual CWeaponStat* CreateWeaponStat(eWeaponType weaponType, eWeaponSkill weaponSkill) = 0; @@ -265,8 +268,9 @@ class __declspec(novtable) CGame virtual int32_t GetBaseIDforSCM() = 0; virtual int32_t GetCountOfAllFileIDs() = 0; - virtual void RemoveAllBuildings() = 0; + virtual void RemoveAllBuildings(bool clearBuildingRemoval = true) = 0; virtual void RestoreGameBuildings() = 0; virtual bool SetBuildingPoolSize(size_t size) = 0; + }; diff --git a/Client/sdk/game/CHandlingManager.h b/Client/sdk/game/CHandlingManager.h index ae0ad669d9..d57959b3de 100644 --- a/Client/sdk/game/CHandlingManager.h +++ b/Client/sdk/game/CHandlingManager.h @@ -1,11 +1,11 @@ /***************************************************************************** * - * PROJECT: Multi Theft Auto v1.0 + * PROJECT: Multi Theft Auto * LICENSE: See LICENSE in the top level directory - * FILE: sdk/game/CHandlingManager.h + * FILE: Client/sdk/game/CHandlingManager.h * PURPOSE: Vehicle handling manager interface * - * Multi Theft Auto is available from http://www.multitheftauto.com/ + * Multi Theft Auto is available from https://multitheftauto.com/ * *****************************************************************************/ @@ -32,7 +32,7 @@ class CHandlingManager virtual const CBoatHandlingEntry* GetOriginalBoatHandlingData(enum eVehicleTypes eModel) = 0; virtual const CBikeHandlingEntry* GetOriginalBikeHandlingData(enum eVehicleTypes eModel) = 0; - virtual eHandlingProperty GetPropertyEnumFromName(std::string strName) = 0; + virtual eHandlingProperty GetPropertyEnumFromName(const std::string& strName) = 0; virtual void RemoveChangedVehicle() = 0; virtual void CheckSuspensionChanges(CHandlingEntry* pEntry) = 0; }; diff --git a/Client/sdk/game/CPed.h b/Client/sdk/game/CPed.h index ca7441f2ac..29bbf60104 100644 --- a/Client/sdk/game/CPed.h +++ b/Client/sdk/game/CPed.h @@ -25,6 +25,7 @@ class CTaskManager; class CVehicle; class CWeapon; class CWeaponStat; +class CProjectileSAInterface; enum ePedPieceTypes { @@ -170,6 +171,13 @@ namespace EPedWeaponAudioEvent } using EPedWeaponAudioEvent::EPedWeaponAudioEventType; +struct SSatchelsData +{ + CProjectileSAInterface* pProjectileInterface; + CVector* vecAttachedOffsets; + CVector* vecAttachedRotation; +}; + class CPed : public virtual CPhysical { public: @@ -277,4 +285,6 @@ class CPed : public virtual CPhysical virtual CPedIKSAInterface* GetPedIKInterface() = 0; virtual void* GetPedNodeInterface(std::int32_t nodeId) = 0; virtual std::unique_ptr GetPedIK() = 0; + + virtual void GetAttachedSatchels(std::vector &satchelsList) const = 0; }; diff --git a/Client/sdk/game/CVehicle.h b/Client/sdk/game/CVehicle.h index 2dfcc654b9..356fe40470 100644 --- a/Client/sdk/game/CVehicle.h +++ b/Client/sdk/game/CVehicle.h @@ -221,6 +221,7 @@ class CVehicle : public virtual CPhysical virtual void SetAdjustablePropertyValue(unsigned short usAdjustableProperty) = 0; virtual void SetHeliRotorSpeed(float fSpeed) = 0; virtual void SetPlaneRotorSpeed(float fSpeed) = 0; + virtual bool SetVehicleWheelRotation(float fRot1, float fRot2, float fRot3, float fRot4) noexcept = 0; virtual void SetTaxiLightOn(bool bLightState) = 0; virtual void SetExplodeTime(unsigned long ulTime) = 0; virtual void SetRadioStatus(bool bStatus) = 0; diff --git a/Client/sdk/game/CWeather.h b/Client/sdk/game/CWeather.h index 36fbf0dd78..41461142e7 100644 --- a/Client/sdk/game/CWeather.h +++ b/Client/sdk/game/CWeather.h @@ -23,4 +23,32 @@ class CWeather virtual float GetAmountOfRain() = 0; virtual void SetAmountOfRain(float fAmount) = 0; virtual void ResetAmountOfRain() = 0; + + virtual float GetWetRoads() const = 0; + virtual bool SetWetRoads(float fAmount) = 0; + virtual bool ResetWetRoads() = 0; + + virtual float GetFoggyness() const = 0; + virtual bool SetFoggyness(float fAmount) = 0; + virtual bool ResetFoggyness() = 0; + + virtual float GetFog() const = 0; + virtual bool SetFog(float fAmount) = 0; + virtual bool ResetFog() = 0; + + virtual float GetRainFog() const = 0; + virtual bool SetRainFog(float fAmount) = 0; + virtual bool ResetRainFog() = 0; + + virtual float GetWaterFog() const = 0; + virtual bool SetWaterFog(float fAmount) = 0; + virtual bool ResetWaterFog() = 0; + + virtual float GetSandstorm() const = 0; + virtual bool SetSandstorm(float fAmount) = 0; + virtual bool ResetSandstorm() = 0; + + virtual float GetRainbow() const = 0; + virtual bool SetRainbow(float fAmount) = 0; + virtual bool ResetRainbow() = 0; }; diff --git a/Client/sdk/game/Common.h b/Client/sdk/game/Common.h index d746ddb93e..11e5a31554 100644 --- a/Client/sdk/game/Common.h +++ b/Client/sdk/game/Common.h @@ -1,11 +1,11 @@ /***************************************************************************** * - * PROJECT: Multi Theft Auto v1.0 + * PROJECT: Multi Theft Auto * LICENSE: See LICENSE in the top level directory - * FILE: sdk/game/Common.h + * FILE: Client/sdk/game/Common.h * PURPOSE: Grand Theft Auto: San Andreas game definitions * - * Multi Theft Auto is available from http://www.multitheftauto.com/ + * Multi Theft Auto is available from https://multitheftauto.com/ * *****************************************************************************/ @@ -1620,3 +1620,27 @@ enum class eFxParticleSystems PRT_WHEELDIRT, PRT_GLASS, }; + +enum eWorldProperty +{ + AMBIENT_COLOR, + AMBIENT_OBJ_COLOR, + DIRECTIONAL_COLOR, + SPRITE_SIZE, + SPRITE_BRIGHTNESS, + POLE_SHADOW_STRENGTH, + SHADOW_STRENGTH, + SHADOWS_OFFSET, + LIGHTS_ON_GROUND, + LOW_CLOUDS_COLOR, + BOTTOM_CLOUDS_COLOR, + CLOUDS_ALPHA1, + ILLUMINATION, + WEATHER_WET_ROADS, + WEATHER_FOGGYNESS, + WEATHER_FOG, + WEATHER_RAIN_FOG, + WEATHER_WATER_FOG, + WEATHER_SANDSTORM, + WEATHER_RAINBOW, +}; diff --git a/Client/sdk/multiplayer/CMultiplayer.h b/Client/sdk/multiplayer/CMultiplayer.h index 48f1f3246c..75fff4801f 100644 --- a/Client/sdk/multiplayer/CMultiplayer.h +++ b/Client/sdk/multiplayer/CMultiplayer.h @@ -310,6 +310,58 @@ class CMultiplayer virtual int GetMoonSize() = 0; virtual void ResetMoonSize() = 0; + virtual void GetAmbientColor(float& red, float& green, float& blue) const = 0; + virtual bool SetAmbientColor(float red, float green, float blue) = 0; + virtual bool ResetAmbientColor() = 0; + + virtual void GetAmbientObjectColor(float& red, float& green, float& blue) const = 0; + virtual bool SetAmbientObjectColor(float red, float green, float blue) = 0; + virtual bool ResetAmbientObjectColor() = 0; + + virtual void GetDirectionalColor(float& red, float& green, float& blue) const = 0; + virtual bool SetDirectionalColor(float red, float green, float blue) = 0; + virtual bool ResetDirectionalColor() = 0; + + virtual float GetSpriteSize() const = 0; + virtual bool SetSpriteSize(float size) = 0; + virtual bool ResetSpriteSize() = 0; + + virtual float GetSpriteBrightness() const = 0; + virtual bool SetSpriteBrightness(float brightness) = 0; + virtual bool ResetSpriteBrightness() = 0; + + virtual int16 GetPoleShadowStrength() const = 0; + virtual bool SetPoleShadowStrength(int16 strength) = 0; + virtual bool ResetPoleShadowStrength() = 0; + + virtual int16 GetShadowStrength() const = 0; + virtual bool SetShadowStrength(int16 strength) = 0; + virtual bool ResetShadowStrength() = 0; + + virtual float GetShadowsOffset() const = 0; + virtual bool SetShadowsOffset(float offset) = 0; + virtual bool ResetShadowsOffset() = 0; + + virtual float GetLightsOnGroundBrightness() const = 0; + virtual bool SetLightsOnGroundBrightness(float brightness) = 0; + virtual bool ResetLightsOnGroundBrightness() = 0; + + virtual void GetLowCloudsColor(int16& red, int16& green, int16& blue) const = 0; + virtual bool SetLowCloudsColor(int16 red, int16 green, int16 blue) = 0; + virtual bool ResetLowCloudsColor() = 0; + + virtual void GetBottomCloudsColor(int16& red, int16& green, int16& blue) const = 0; + virtual bool SetBottomCloudsColor(int16 red, int16 green, int16 blue) = 0; + virtual bool ResetBottomCloudsColor() = 0; + + virtual float GetCloudsAlpha1() const = 0; + virtual bool SetCloudsAlpha1(float alpha) = 0; + virtual bool ResetCloudsAlpha1() = 0; + + virtual float GetIllumination() const = 0; + virtual bool SetIllumination(float illumination) = 0; + virtual bool ResetIllumination() = 0; + virtual void DisableEnterExitVehicleKey(bool bDisabled) = 0; virtual void SetNightVisionEnabled(bool bEnabled, bool bNoiseEnabled) = 0; diff --git a/README.md b/README.md index 0173284d06..27221cabf3 100644 --- a/README.md +++ b/README.md @@ -131,4 +131,4 @@ Execute `win-create-projects.bat` Unless otherwise specified, all source code hosted on this repository is licensed under the GPLv3 license. See the [LICENSE](./LICENSE) file for more details. -Grand Theft Auto and all related trademarks are © Rockstar North 1997–2023. +Grand Theft Auto and all related trademarks are © Rockstar North 1997–2024. diff --git a/Server/mods/deathmatch/logic/CConsoleCommands.cpp b/Server/mods/deathmatch/logic/CConsoleCommands.cpp index 7d749e5c55..5f19e566f3 100644 --- a/Server/mods/deathmatch/logic/CConsoleCommands.cpp +++ b/Server/mods/deathmatch/logic/CConsoleCommands.cpp @@ -1238,62 +1238,51 @@ bool CConsoleCommands::WhoIs(CConsole* pConsole, const char* szArguments, CClien return false; } -bool CConsoleCommands::DebugScript(CConsole* pConsole, const char* szArguments, CClient* pClient, CClient* pEchoClient) +bool CConsoleCommands::DebugScript(CConsole* console, const char* arguments, CClient* client, CClient* echoClient) { - // Valid parameter? - if (szArguments && szArguments[0] != 0 && szArguments[1] == 0) + static constexpr const char* syntaxMessage = "debugscript: Syntax is 'debugscript '"; + + // Validate arguments + if (!arguments || std::strlen(arguments) != 1 || !std::isdigit(arguments[0])) { - // Player? - if (pClient->GetClientType() == CClient::CLIENT_PLAYER) - { - CPlayer* pPlayer = static_cast(pClient); + echoClient->SendEcho(syntaxMessage); + return false; + } - // Convert to number - int iLevel = atoi(szArguments); - if (iLevel == 0 && strcmp(szArguments, "0") != 0) - { - pEchoClient->SendEcho("debugscript: Syntax is 'debugscript '"); - return false; - } - if (iLevel != (int)pPlayer->GetScriptDebugLevel()) - { - // Between 0 and 3? - if (iLevel >= 0 && iLevel <= 3) - { - // Set the new level - pPlayer->SetScriptDebugLevel(iLevel); + // Check client type + if (client->GetClientType() != CClient::CLIENT_PLAYER) + { + echoClient->SendConsole("debugscript: Incorrect client type for this command"); + return false; + } - // Tell the player and the console - pEchoClient->SendEcho(SString("debugscript: Your debug mode was set to %i", iLevel)); - CLogger::LogPrintf("SCRIPT: %s set their script debug mode to %i\n", GetAdminNameForLog(pClient).c_str(), iLevel); + CPlayer* player = static_cast(client); + int debugLevel = arguments[0] - '0'; // Convert the character to an integer (e.g., '2' -> 2) + int debugLevelCurrent = player->GetScriptDebugLevel(); - // Enable/Disable their debugger - if (iLevel == 0) - CStaticFunctionDefinitions::SetPlayerDebuggerVisible(pPlayer, false); - else - CStaticFunctionDefinitions::SetPlayerDebuggerVisible(pPlayer, true); - } - else - { - pEchoClient->SendEcho("debugscript: Modes available are 0 (None), 1 (Errors), 2 (Errors + Warnings), 3 (All)"); - } - } - else - { - pEchoClient->SendEcho("debugscript: Your debug mode is already that"); - } - } - else - { - pEchoClient->SendConsole("debugscript: Incorrect client type for this command"); - } + // Check if the level is the same + if (debugLevel == debugLevelCurrent) + { + echoClient->SendEcho(("debugscript: Your debug mode is already set to " + std::to_string(debugLevel)).c_str()); + return false; } - else + + // Check if the level is between 0 and 3 + if (debugLevel < 0 || debugLevel > 3) { - pEchoClient->SendEcho("debugscript: Syntax is 'debugscript '"); + echoClient->SendEcho(syntaxMessage); + return false; } - return false; + // Set the new level + player->SetScriptDebugLevel(debugLevel); + echoClient->SendEcho(("debugscript: Your debug mode was set to " + std::to_string(debugLevel)).c_str()); + CLogger::LogPrintf("SCRIPT: %s set their script debug mode to %d\n", GetAdminNameForLog(client).c_str(), debugLevel); + + // Enable or disable the debugger based on the level + CStaticFunctionDefinitions::SetPlayerDebuggerVisible(player, debugLevel != 0); + + return true; } bool CConsoleCommands::Help(CConsole* pConsole, const char* szArguments, CClient* pClient, CClient* pEchoClient) diff --git a/Server/mods/deathmatch/logic/CGame.cpp b/Server/mods/deathmatch/logic/CGame.cpp index 75fc4aaae6..5e170324b5 100644 --- a/Server/mods/deathmatch/logic/CGame.cpp +++ b/Server/mods/deathmatch/logic/CGame.cpp @@ -1,11 +1,11 @@ /***************************************************************************** * - * PROJECT: Multi Theft Auto v1.0 + * PROJECT: Multi Theft Auto * LICENSE: See LICENSE in the top level directory - * FILE: mods/deathmatch/logic/CGame.cpp + * FILE: Server/mods/deathmatch/logic/CGame.cpp * PURPOSE: Server game class * - * Multi Theft Auto is available from http://www.multitheftauto.com/ + * Multi Theft Auto is available from https://multitheftauto.com/ * *****************************************************************************/ @@ -248,6 +248,7 @@ CGame::CGame() : m_FloodProtect(4, 30000, 30000) // Max of 4 connecti m_WorldSpecialProps[WorldSpecialProperty::FIREBALLDESTRUCT] = true; m_WorldSpecialProps[WorldSpecialProperty::EXTENDEDWATERCANNONS] = true; m_WorldSpecialProps[WorldSpecialProperty::ROADSIGNSTEXT] = true; + m_WorldSpecialProps[WorldSpecialProperty::TUNNELWEATHERBLEND] = true; m_JetpackWeapons[WEAPONTYPE_MICRO_UZI] = true; m_JetpackWeapons[WEAPONTYPE_TEC9] = true; @@ -1569,7 +1570,7 @@ void CGame::AddBuiltInEvents() m_Events.AddEvent("onPlayerQuit", "reason", NULL, false); m_Events.AddEvent("onPlayerSpawn", "spawnpoint, team", NULL, false); m_Events.AddEvent("onPlayerTarget", "target", NULL, false); - m_Events.AddEvent("onPlayerWasted", "ammo, killer, weapon, bodypart", NULL, false); + m_Events.AddEvent("onPlayerWasted", "ammo, killer, weapon, bodypart, isStealth, animGroup, animID", nullptr, false); m_Events.AddEvent("onPlayerWeaponSwitch", "previous, current", NULL, false); m_Events.AddEvent("onPlayerMarkerHit", "marker, matchingDimension", NULL, false); m_Events.AddEvent("onPlayerMarkerLeave", "marker, matchingDimension", NULL, false); @@ -1601,7 +1602,7 @@ void CGame::AddBuiltInEvents() // Ped events m_Events.AddEvent("onPedVehicleEnter", "vehicle, seat, jacked", NULL, false); m_Events.AddEvent("onPedVehicleExit", "vehicle, reason, jacker", NULL, false); - m_Events.AddEvent("onPedWasted", "ammo, killer, weapon, bodypart", NULL, false); + m_Events.AddEvent("onPedWasted", "ammo, killer, weapon, bodypart, isStealth, animGroup, animID", nullptr, false); m_Events.AddEvent("onPedWeaponSwitch", "previous, current", NULL, false); m_Events.AddEvent("onPedDamage", "loss", NULL, false); @@ -2044,6 +2045,8 @@ void CGame::Packet_PedWasted(CPedWastedPacket& Packet) else Arguments.PushBoolean(false); Arguments.PushBoolean(false); + Arguments.PushNumber(Packet.m_AnimGroup); + Arguments.PushNumber(Packet.m_AnimID); pPed->CallEvent("onPedWasted", Arguments); // Reset the weapons list, because a ped loses his weapons on death @@ -2104,6 +2107,8 @@ void CGame::Packet_PlayerWasted(CPlayerWastedPacket& Packet) else Arguments.PushBoolean(false); Arguments.PushBoolean(false); + Arguments.PushNumber(Packet.m_AnimGroup); + Arguments.PushNumber(Packet.m_AnimID); pPlayer->CallEvent("onPlayerWasted", Arguments); // Reset the weapons list, because a player loses his weapons on death diff --git a/Server/mods/deathmatch/logic/CHandlingManager.cpp b/Server/mods/deathmatch/logic/CHandlingManager.cpp index d5b9630051..8f7be518c9 100644 --- a/Server/mods/deathmatch/logic/CHandlingManager.cpp +++ b/Server/mods/deathmatch/logic/CHandlingManager.cpp @@ -1,11 +1,11 @@ /***************************************************************************** * - * PROJECT: Multi Theft Auto v1.0 + * PROJECT: Multi Theft Auto * LICENSE: See LICENSE in the top level directory - * FILE: mods/deathmatch/logic/CHandlingManager.cpp + * FILE: Server/mods/deathmatch/logic/CHandlingManager.cpp * PURPOSE: Vehicle handling manager * - * Multi Theft Auto is available from http://www.multitheftauto.com/ + * Multi Theft Auto is available from https://multitheftauto.com/ * *****************************************************************************/ @@ -24,15 +24,13 @@ CHandlingManager::CHandlingManager() // Initialize all default handlings InitializeDefaultHandlings(); - // Create a handling entry for every original handling data + // Create a handling entry for (int i = 0; i < HT_MAX; i++) { + // For every original handling data m_pOriginalEntries[i] = new CHandlingEntry(&m_OriginalHandlingData[i]); - } - // Create a handling entry for every model - for (int i = 0; i < HT_MAX; i++) - { + // For every model m_pModelEntries[i] = new CHandlingEntry(&m_OriginalHandlingData[i]); m_bModelHandlingChanged[i] = false; } @@ -78,97 +76,83 @@ CHandlingManager::CHandlingManager() CHandlingManager::~CHandlingManager() { - // Destroy all original handling entries + // Destroy for (int i = 0; i < HT_MAX; i++) { + // All original handling entries delete m_pOriginalEntries[i]; - } - // Destroy all model handling entries - for (int i = 0; i < HT_MAX; i++) - { + // All model handling entries delete m_pModelEntries[i]; } } CHandlingEntry* CHandlingManager::CreateHandlingData() { - CHandlingEntry* pHandlingEntry = new CHandlingEntry(); - return pHandlingEntry; + return new CHandlingEntry; } bool CHandlingManager::ApplyHandlingData(eVehicleTypes eModel, CHandlingEntry* pEntry) { // Within range? - if (CVehicleManager::IsValidModel(eModel)) - { - // Get our Handling ID - eHandlingTypes eHandling = GetHandlingID(eModel); - // Apply the data and return success - m_pModelEntries[eHandling]->ApplyHandlingData(pEntry); - return true; - } + if (!CVehicleManager::IsValidModel(eModel)) + return false; - // Failed - return false; + // Get our Handling ID + eHandlingTypes eHandling = GetHandlingID(eModel); + // Apply the data and return success + m_pModelEntries[eHandling]->ApplyHandlingData(pEntry); + return true; } const CHandlingEntry* CHandlingManager::GetOriginalHandlingData(eVehicleTypes eModel) { // Within range? - if (CVehicleManager::IsValidModel(eModel)) - { - // Get our Handling ID - eHandlingTypes eHandling = GetHandlingID(eModel); - // Return it - return m_pOriginalEntries[eHandling]; - } + if (!CVehicleManager::IsValidModel(eModel)) + return nullptr; - return NULL; + // Get our Handling ID + eHandlingTypes eHandling = GetHandlingID(eModel); + // Return it + return m_pOriginalEntries[eHandling]; } const CHandlingEntry* CHandlingManager::GetModelHandlingData(eVehicleTypes eModel) { // Within range? - if (CVehicleManager::IsValidModel(eModel)) - { - // Get our Handling ID - eHandlingTypes eHandling = GetHandlingID(eModel); - // Return it - return m_pModelEntries[eHandling]; - } + if (!CVehicleManager::IsValidModel(eModel)) + return nullptr; - return NULL; + // Get our Handling ID + eHandlingTypes eHandling = GetHandlingID(eModel); + // Return it + return m_pModelEntries[eHandling]; } -eHandlingProperty CHandlingManager::GetPropertyEnumFromName(std::string strName) +eHandlingProperty CHandlingManager::GetPropertyEnumFromName(const std::string& strName) { - std::map::iterator it; - it = m_HandlingNames.find(strName); - - if (it != m_HandlingNames.end()) - { - return it->second; - } - - return HANDLING_MAX; + const auto it = m_HandlingNames.find(strName); + return it != m_HandlingNames.end() ? it->second : HANDLING_MAX; } bool CHandlingManager::HasModelHandlingChanged(eVehicleTypes eModel) { // Within range? - if (CVehicleManager::IsValidModel(eModel)) - { - // Get our Handling ID - eHandlingTypes eHandling = GetHandlingID(eModel); - // Return if we have changed - return m_bModelHandlingChanged[eHandling]; - } - return false; + if (!CVehicleManager::IsValidModel(eModel)) + return false; + + // Get our Handling ID + eHandlingTypes eHandling = GetHandlingID(eModel); + // Return if we have changed + return m_bModelHandlingChanged[eHandling]; } void CHandlingManager::SetModelHandlingHasChanged(eVehicleTypes eModel, bool bChanged) { + // Within range? + if (!CVehicleManager::IsValidModel(eModel)) + return; + // Get our Handling ID eHandlingTypes eHandling = GetHandlingID(eModel); // Return if we have changed. diff --git a/Server/mods/deathmatch/logic/CHandlingManager.h b/Server/mods/deathmatch/logic/CHandlingManager.h index 21e54e1d55..4d52c5cc18 100644 --- a/Server/mods/deathmatch/logic/CHandlingManager.h +++ b/Server/mods/deathmatch/logic/CHandlingManager.h @@ -1,11 +1,11 @@ /***************************************************************************** * - * PROJECT: Multi Theft Auto v1.0 + * PROJECT: Multi Theft Auto * LICENSE: See LICENSE in the top level directory - * FILE: mods/deathmatch/logic/CHandlingManager.h + * FILE: Server/mods/deathmatch/logic/CHandlingManager.h * PURPOSE: Header file for vehicle handling manager class * - * Multi Theft Auto is available from http://www.multitheftauto.com/ + * Multi Theft Auto is available from https://multitheftauto.com/ * *****************************************************************************/ @@ -32,7 +32,7 @@ class CHandlingManager eHandlingTypes GetHandlingID(eVehicleTypes eModel); // Helper functions - eHandlingProperty GetPropertyEnumFromName(std::string strName); + eHandlingProperty GetPropertyEnumFromName(const std::string& strName); bool HasModelHandlingChanged(eVehicleTypes eModel); void SetModelHandlingHasChanged(eVehicleTypes eModel, bool bChanged); diff --git a/Server/mods/deathmatch/logic/CMarker.cpp b/Server/mods/deathmatch/logic/CMarker.cpp index 0fc93ba76f..6709f4bb89 100644 --- a/Server/mods/deathmatch/logic/CMarker.cpp +++ b/Server/mods/deathmatch/logic/CMarker.cpp @@ -33,6 +33,9 @@ CMarker::CMarker(CMarkerManager* pMarkerManager, CColManager* pColManager, CElem m_Color = SColorRGBA(255, 255, 255, 255); m_bHasTarget = false; m_ucIcon = ICON_NONE; + m_ignoreAlphaLimits = false; + m_TargetArrowColor = SColorRGBA(255, 64, 64, 255); + m_TargetArrowSize = m_fSize * 0.625f; // Create our collision object m_pCollision = new CColCircle(pColManager, nullptr, m_vecPosition, m_fSize, true); @@ -261,6 +264,8 @@ void CMarker::SetSize(float fSize) { // Set the new size and update the col object m_fSize = fSize; + m_TargetArrowSize = fSize * 0.625f; + UpdateCollisionObject(m_ucType); // Tell all players @@ -278,12 +283,20 @@ void CMarker::SetColor(const SColor color) // Set the new color m_Color = color; + if (!m_ignoreAlphaLimits) + { + if (m_ucType == CMarker::TYPE_CHECKPOINT) + m_Color.A = 128; + else if (m_ucType == CMarker::TYPE_ARROW) + m_Color.A = 255; + } + // Tell all the players CBitStream BitStream; - BitStream.pBitStream->Write(color.B); - BitStream.pBitStream->Write(color.G); - BitStream.pBitStream->Write(color.R); - BitStream.pBitStream->Write(color.A); + BitStream.pBitStream->Write(m_Color.B); + BitStream.pBitStream->Write(m_Color.G); + BitStream.pBitStream->Write(m_Color.R); + BitStream.pBitStream->Write(m_Color.A); BroadcastOnlyVisible(CElementRPCPacket(this, SET_MARKER_COLOR, *BitStream.pBitStream)); } } @@ -301,6 +314,23 @@ void CMarker::SetIcon(unsigned char ucIcon) } } +void CMarker::SetTargetArrowProperties(const SColor color, float size) noexcept +{ + if (m_TargetArrowColor == color && m_TargetArrowSize == size) + return; + + m_TargetArrowColor = color; + m_TargetArrowSize = size; + + CBitStream BitStream; + BitStream.pBitStream->Write(color.R); + BitStream.pBitStream->Write(color.G); + BitStream.pBitStream->Write(color.B); + BitStream.pBitStream->Write(color.A); + BitStream.pBitStream->Write(size); + BroadcastOnlyVisible(CElementRPCPacket(this, SET_MARKER_TARGET_ARROW_PROPERTIES, *BitStream.pBitStream)); +} + void CMarker::Callback_OnCollision(CColShape& Shape, CElement& Element) { // Do not call on ourselves #7359 diff --git a/Server/mods/deathmatch/logic/CMarker.h b/Server/mods/deathmatch/logic/CMarker.h index 345ed39a47..6787940871 100644 --- a/Server/mods/deathmatch/logic/CMarker.h +++ b/Server/mods/deathmatch/logic/CMarker.h @@ -67,6 +67,13 @@ class CMarker : public CPerPlayerEntity, private CColCallback virtual CSphere GetWorldBoundingSphere(); + void SetIgnoreAlphaLimits(bool ignore) noexcept { m_ignoreAlphaLimits = ignore; }; + bool AreAlphaLimitsIgnored() const noexcept { return m_ignoreAlphaLimits; }; + + SColor GetTargetArrowColor() const noexcept { return m_TargetArrowColor; }; + float GetTargetArrowSize() const noexcept { return m_TargetArrowSize; }; + void SetTargetArrowProperties(const SColor color, float size) noexcept; + protected: bool ReadSpecialData(const int iLine) override; @@ -85,6 +92,9 @@ class CMarker : public CPerPlayerEntity, private CColCallback float m_fSize; SColor m_Color; unsigned char m_ucIcon; + bool m_ignoreAlphaLimits; + SColor m_TargetArrowColor; + float m_TargetArrowSize; CColShape* m_pCollision; }; diff --git a/Server/mods/deathmatch/logic/CPerfStat.RPCPacketUsage.cpp b/Server/mods/deathmatch/logic/CPerfStat.RPCPacketUsage.cpp index 8ba4a7573f..2f9cfa8ce9 100644 --- a/Server/mods/deathmatch/logic/CPerfStat.RPCPacketUsage.cpp +++ b/Server/mods/deathmatch/logic/CPerfStat.RPCPacketUsage.cpp @@ -225,6 +225,7 @@ ADD_ENUM1(SET_DISCORD_JOIN_PARAMETERS) ADD_ENUM1(SET_COLPOLYGON_HEIGHT) ADD_ENUM1(SET_OBJECT_BREAKABLE) ADD_ENUM1(BREAK_OBJECT) +ADD_ENUM1(SET_PLAYER_SCRIPT_DEBUG_LEVEL) IMPLEMENT_ENUM_END("eElementRPCFunctions") DECLARE_ENUM(CRPCFunctions::eRPCFunctions); diff --git a/Server/mods/deathmatch/logic/CPlayer.cpp b/Server/mods/deathmatch/logic/CPlayer.cpp index 5d4fee6401..bf9d6b07d4 100644 --- a/Server/mods/deathmatch/logic/CPlayer.cpp +++ b/Server/mods/deathmatch/logic/CPlayer.cpp @@ -22,6 +22,7 @@ #include "CBandwidthSettings.h" #include "CUnoccupiedVehicleSync.h" #include "CScriptDebugging.h" +#include "packets/CLuaPacket.h" #include "packets/CConsoleEchoPacket.h" #include "packets/CChatEchoPacket.h" #include "CWeaponStatManager.h" @@ -470,9 +471,16 @@ void CPlayer::RemoveAllSyncingObjects() } } -bool CPlayer::SetScriptDebugLevel(unsigned int uiLevel) +bool CPlayer::SetScriptDebugLevel(std::uint8_t level) { - return m_pScriptDebugging->AddPlayer(*this, uiLevel); + if (!m_pScriptDebugging->AddPlayer(*this, level)) + return false; + + CPlayerBitStream BitStream(this); + BitStream.pBitStream->Write(level); + + Send(CLuaPacket(SET_PLAYER_SCRIPT_DEBUG_LEVEL, *BitStream.pBitStream)); + return true; } void CPlayer::SetDamageInfo(ElementID ElementID, unsigned char ucWeapon, unsigned char ucBodyPart) diff --git a/Server/mods/deathmatch/logic/CPlayer.h b/Server/mods/deathmatch/logic/CPlayer.h index bb64a6f51a..feded36e51 100644 --- a/Server/mods/deathmatch/logic/CPlayer.h +++ b/Server/mods/deathmatch/logic/CPlayer.h @@ -167,7 +167,7 @@ class CPlayer final : public CPed, public CClient std::list::const_iterator IterSyncingObjectEnd() { return m_SyncingObjects.end(); }; unsigned int GetScriptDebugLevel() { return m_uiScriptDebugLevel; }; - bool SetScriptDebugLevel(unsigned int uiLevel); + bool SetScriptDebugLevel(std::uint8_t level); void SetDamageInfo(ElementID ElementID, unsigned char ucWeapon, unsigned char ucBodyPart); void ValidateDamageInfo(); diff --git a/Server/mods/deathmatch/logic/CScriptDebugging.cpp b/Server/mods/deathmatch/logic/CScriptDebugging.cpp index b00f961743..8c38aed824 100644 --- a/Server/mods/deathmatch/logic/CScriptDebugging.cpp +++ b/Server/mods/deathmatch/logic/CScriptDebugging.cpp @@ -146,13 +146,13 @@ void CScriptDebugging::PrintLog(const char* szText) void CScriptDebugging::Broadcast(const CPacket& Packet, unsigned int uiMinimumDebugLevel) { // Tell everyone we log to about it - list::const_iterator iter = m_Players.begin(); - auto uiRequiredDebugLevel = std::min(uiMinimumDebugLevel, 3u); // Make sure it doesn't skip outputDebugString with level 4 - for (; iter != m_Players.end(); iter++) + for (const auto& pPlayer : m_Players) { - if ((*iter)->m_uiScriptDebugLevel >= uiRequiredDebugLevel) + bool sufficientDebugLevel = CheckForSufficientDebugLevel(pPlayer->m_uiScriptDebugLevel, uiMinimumDebugLevel); + + if (sufficientDebugLevel) { - (*iter)->Send(Packet); + pPlayer->Send(Packet); } } } diff --git a/Server/mods/deathmatch/logic/CScriptDebugging.h b/Server/mods/deathmatch/logic/CScriptDebugging.h index 116b4825b2..e6ef81a0e1 100644 --- a/Server/mods/deathmatch/logic/CScriptDebugging.h +++ b/Server/mods/deathmatch/logic/CScriptDebugging.h @@ -73,6 +73,7 @@ class CScriptDebugging unsigned char ucGreen = 255, unsigned char ucBlue = 255); void PrintLog(const char* szText); + bool CheckForSufficientDebugLevel(std::uint8_t playerDebugLevel, std::uint8_t messageDebugLevel) const noexcept; void Broadcast(const CPacket& Packet, unsigned int uiMinimumDebugLevel); unsigned int m_uiLogFileLevel; diff --git a/Server/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp b/Server/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp index 2036b12a70..c7ce99d91e 100644 --- a/Server/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp +++ b/Server/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp @@ -1,11 +1,11 @@ /***************************************************************************** * - * PROJECT: Multi Theft Auto v1.0 + * PROJECT: Multi Theft Auto * LICENSE: See LICENSE in the top level directory - * FILE: mods/deathmatch/logic/CStaticFunctionDefinitions.cpp + * FILE: Server/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp * PURPOSE: Lua static function definitions class * - * Multi Theft Auto is available from http://www.multitheftauto.com/ + * Multi Theft Auto is available from https://multitheftauto.com/ * *****************************************************************************/ @@ -1669,6 +1669,9 @@ bool CStaticFunctionDefinitions::SetElementHealth(CElement* pElement, float fHea unsigned char ucHealth = static_cast(fHealth * 1.25f); fHealth = static_cast(ucHealth) / 1.25f; pPed->SetHealth(fHealth); + + if (pPed->IsDead() && fHealth > 0.0f) + pPed->SetIsDead(false); } else return false; @@ -3750,6 +3753,8 @@ bool CStaticFunctionDefinitions::KillPed(CElement* pElement, CElement* pKiller, else Arguments.PushBoolean(false); Arguments.PushBoolean(bStealth); + Arguments.PushBoolean(false); + Arguments.PushBoolean(false); // TODO: change to onPedWasted if (IS_PLAYER(pPed)) { @@ -4138,6 +4143,8 @@ bool CStaticFunctionDefinitions::SetPedWeaponSlot(CElement* pElement, unsigned c CPed* pPed = static_cast(pElement); if (pPed->IsSpawned()) { + pPed->SetWeaponSlot(ucWeaponSlot); + CBitStream BitStream; SWeaponSlotSync slot; @@ -5009,6 +5016,7 @@ bool CStaticFunctionDefinitions::RemoveVehicleSirens(CVehicle* pVehicle) assert(pVehicle); pVehicle->m_tSirenBeaconInfo.m_bOverrideSirens = false; + pVehicle->SetSirenActive(false); pVehicle->RemoveVehicleSirens(); CBitStream BitStream; @@ -7658,7 +7666,7 @@ bool CStaticFunctionDefinitions::SetVehicleDoorOpenRatio(CElement* pElement, uns } CMarker* CStaticFunctionDefinitions::CreateMarker(CResource* pResource, const CVector& vecPosition, const char* szType, float fSize, const SColor color, - CElement* pVisibleTo) + CElement* pVisibleTo, bool ignoreAlphaLimits) { assert(szType); @@ -7674,6 +7682,7 @@ CMarker* CStaticFunctionDefinitions::CreateMarker(CResource* pResource, const CV // Set the properties pMarker->SetPosition(vecPosition); pMarker->SetMarkerType(ucType); + pMarker->SetIgnoreAlphaLimits(ignoreAlphaLimits); pMarker->SetColor(color); pMarker->SetSize(fSize); @@ -7846,6 +7855,24 @@ bool CStaticFunctionDefinitions::SetMarkerIcon(CElement* pElement, const char* s return false; } +bool CStaticFunctionDefinitions::SetMarkerTargetArrowProperties(CElement* pElement, const SColor color, float size) +{ + RUN_CHILDREN(SetMarkerTargetArrowProperties(*iter, color, size)) + + if (!IS_MARKER(pElement)) + return false; + + CMarker* marker = static_cast(pElement); + if (!marker) + return false; + + if (!marker->HasTarget() || marker->GetMarkerType() != CMarker::TYPE_CHECKPOINT) + return false; + + marker->SetTargetArrowProperties(color, size); + return true; +} + CBlip* CStaticFunctionDefinitions::CreateBlip(CResource* pResource, const CVector& vecPosition, unsigned char ucIcon, unsigned char ucSize, const SColor color, short sOrdering, unsigned short usVisibleDistance, CElement* pVisibleTo) { diff --git a/Server/mods/deathmatch/logic/CStaticFunctionDefinitions.h b/Server/mods/deathmatch/logic/CStaticFunctionDefinitions.h index db6fb1874e..2f260e3ea5 100644 --- a/Server/mods/deathmatch/logic/CStaticFunctionDefinitions.h +++ b/Server/mods/deathmatch/logic/CStaticFunctionDefinitions.h @@ -368,7 +368,7 @@ class CStaticFunctionDefinitions static bool RemoveVehicleSirens(CVehicle* pVehicle); // Marker create/destroy functions - static CMarker* CreateMarker(CResource* pResource, const CVector& vecPosition, const char* szType, float fSize, const SColor color, CElement* pVisibleTo); + static CMarker* CreateMarker(CResource* pResource, const CVector& vecPosition, const char* szType, float fSize, const SColor color, CElement* pVisibleTo, bool ignoreAlphaLimits); // Marker get functions static bool GetMarkerCount(unsigned int& uiCount); @@ -385,6 +385,8 @@ class CStaticFunctionDefinitions static bool SetMarkerTarget(CElement* pElement, const CVector* pTarget); static bool SetMarkerIcon(CElement* pElement, const char* szIcon); + static bool SetMarkerTargetArrowProperties(CElement* Element, const SColor color, float size); + // Blip create/destroy functions static CBlip* CreateBlip(CResource* pResource, const CVector& vecPosition, unsigned char ucIcon, unsigned char ucSize, const SColor color, short sOrdering, unsigned short usVisibleDistance, CElement* pVisibleTo); diff --git a/Server/mods/deathmatch/logic/lua/CLuaMain.cpp b/Server/mods/deathmatch/logic/lua/CLuaMain.cpp index dd7df7f040..189d204c57 100644 --- a/Server/mods/deathmatch/logic/lua/CLuaMain.cpp +++ b/Server/mods/deathmatch/logic/lua/CLuaMain.cpp @@ -234,6 +234,9 @@ void CLuaMain::Initialize() lua_pushelement(m_luaVM, m_pResource->GetResourceRootElement()); lua_setglobal(m_luaVM, "resourceRoot"); + + lua_pushstring(m_luaVM, m_pResource->GetName()); + lua_setglobal(m_luaVM, "resourceName"); } void CLuaMain::LoadEmbeddedScripts() diff --git a/Server/mods/deathmatch/logic/luadefs/CLuaMarkerDefs.cpp b/Server/mods/deathmatch/logic/luadefs/CLuaMarkerDefs.cpp index 001bc40b66..b181bc2033 100644 --- a/Server/mods/deathmatch/logic/luadefs/CLuaMarkerDefs.cpp +++ b/Server/mods/deathmatch/logic/luadefs/CLuaMarkerDefs.cpp @@ -12,6 +12,7 @@ #include "CLuaMarkerDefs.h" #include "CStaticFunctionDefinitions.h" #include "CScriptArgReader.h" +#include "lua/CLuaFunctionParser.h" void CLuaMarkerDefs::LoadFunctions() { @@ -26,6 +27,7 @@ void CLuaMarkerDefs::LoadFunctions() {"getMarkerColor", GetMarkerColor}, {"getMarkerTarget", GetMarkerTarget}, {"getMarkerIcon", GetMarkerIcon}, + {"getMarkerTargetArrowProperties", ArgumentParser}, // Marker set functions {"setMarkerType", SetMarkerType}, @@ -33,6 +35,7 @@ void CLuaMarkerDefs::LoadFunctions() {"setMarkerColor", SetMarkerColor}, {"setMarkerTarget", SetMarkerTarget}, {"setMarkerIcon", SetMarkerIcon}, + {"setMarkerTargetArrowProperties", ArgumentParser}, }; // Add functions @@ -76,6 +79,7 @@ int CLuaMarkerDefs::CreateMarker(lua_State* luaVM) SColorRGBA color(0, 0, 255, 255); SString strType; CElement* pVisibleTo; + bool ignoreAlphaLimits; CScriptArgReader argStream(luaVM); argStream.ReadVector3D(vecPosition); @@ -89,10 +93,13 @@ int CLuaMarkerDefs::CreateMarker(lua_State* luaVM) if (argStream.NextIsBool() || argStream.NextIsNil()) { pVisibleTo = NULL; + argStream.m_iIndex++; } else argStream.ReadUserData(pVisibleTo, m_pRootElement); + argStream.ReadBool(ignoreAlphaLimits, false); + if (!argStream.HasErrors()) { CLuaMain* pLuaMain = g_pGame->GetLuaManager()->GetVirtualMachine(luaVM); @@ -102,7 +109,7 @@ int CLuaMarkerDefs::CreateMarker(lua_State* luaVM) if (pResource) { // Create it - CMarker* pMarker = CStaticFunctionDefinitions::CreateMarker(pResource, vecPosition, strType, fSize, color, pVisibleTo); + CMarker* pMarker = CStaticFunctionDefinitions::CreateMarker(pResource, vecPosition, strType, fSize, color, pVisibleTo, ignoreAlphaLimits); if (pMarker) { CElementGroup* pGroup = pResource->GetElementGroup(); @@ -197,7 +204,12 @@ int CLuaMarkerDefs::GetMarkerColor(lua_State* luaVM) lua_pushnumber(luaVM, static_cast(color.R)); lua_pushnumber(luaVM, static_cast(color.G)); lua_pushnumber(luaVM, static_cast(color.B)); - lua_pushnumber(luaVM, static_cast(color.A)); + + if (!pMarker->AreAlphaLimitsIgnored() && (pMarker->GetMarkerType() == CMarker::TYPE_CHECKPOINT || pMarker->GetMarkerType() == CMarker::TYPE_ARROW)) + lua_pushnumber(luaVM, 255); // fake alpha + else + lua_pushnumber(luaVM, static_cast(color.A)); + return 4; } } @@ -410,3 +422,23 @@ int CLuaMarkerDefs::SetMarkerIcon(lua_State* luaVM) lua_pushboolean(luaVM, false); return 1; } + +bool CLuaMarkerDefs::SetMarkerTargetArrowProperties(CMarker* marker, std::optional r, std::optional g, std::optional b, std::optional a, std::optional size) +{ + SColor color; + color.R = r.value_or(255); + color.G = g.value_or(64); + color.B = b.value_or(64); + color.A = a.value_or(255); + + return CStaticFunctionDefinitions::SetMarkerTargetArrowProperties(marker, color, size.value_or(marker->GetSize() * 0.625f)); +} + +std::variant, bool> CLuaMarkerDefs::GetMarkerTargetArrowProperties(CMarker* marker) noexcept +{ + if (!marker->HasTarget() || marker->GetMarkerType() != CMarker::TYPE_CHECKPOINT) + return false; + + SColor color = marker->GetTargetArrowColor(); + return CLuaMultiReturn(color.R, color.G, color.B, color.A, marker->GetTargetArrowSize()); +} diff --git a/Server/mods/deathmatch/logic/luadefs/CLuaMarkerDefs.h b/Server/mods/deathmatch/logic/luadefs/CLuaMarkerDefs.h index 28e84e5ff5..b73d720184 100644 --- a/Server/mods/deathmatch/logic/luadefs/CLuaMarkerDefs.h +++ b/Server/mods/deathmatch/logic/luadefs/CLuaMarkerDefs.h @@ -11,6 +11,7 @@ #pragma once #include "CLuaDefs.h" +#include "lua/CLuaMultiReturn.h" class CLuaMarkerDefs : public CLuaDefs { @@ -35,4 +36,6 @@ class CLuaMarkerDefs : public CLuaDefs LUA_DECLARE(SetMarkerColor); LUA_DECLARE(SetMarkerTarget); LUA_DECLARE(SetMarkerIcon); + static bool SetMarkerTargetArrowProperties(CMarker* marker, std::optional r, std::optional g, std::optional b, std::optional a, std::optional size); + static std::variant, bool> GetMarkerTargetArrowProperties(CMarker* marker) noexcept; }; diff --git a/Server/mods/deathmatch/logic/luadefs/CLuaPedDefs.cpp b/Server/mods/deathmatch/logic/luadefs/CLuaPedDefs.cpp index 281f81f307..8a5a3c8591 100644 --- a/Server/mods/deathmatch/logic/luadefs/CLuaPedDefs.cpp +++ b/Server/mods/deathmatch/logic/luadefs/CLuaPedDefs.cpp @@ -13,6 +13,7 @@ #include "CLuaPedDefs.h" #include "CStaticFunctionDefinitions.h" #include "CScriptArgReader.h" +#include "lua/CLuaFunctionParser.h" void CLuaPedDefs::LoadFunctions() { @@ -64,7 +65,7 @@ void CLuaPedDefs::LoadFunctions() {"warpPedIntoVehicle", WarpPedIntoVehicle}, {"removePedFromVehicle", RemovePedFromVehicle}, {"setPedDoingGangDriveby", SetPedDoingGangDriveby}, - {"setPedAnimation", SetPedAnimation}, + {"setPedAnimation", ArgumentParserWarn}, {"setPedAnimationProgress", SetPedAnimationProgress}, {"setPedAnimationSpeed", SetPedAnimationSpeed}, {"setPedOnFire", SetPedOnFire}, @@ -404,56 +405,33 @@ int CLuaPedDefs::IsPedFrozen(lua_State* luaVM) return 1; } -int CLuaPedDefs::SetPedAnimation(lua_State* luaVM) +bool CLuaPedDefs::SetPedAnimation(CElement* pPed, std::optional> blockName, + std::optional> animName, std::optional time, std::optional loop, + std::optional updatePosition, std::optional interruptable, std::optional freezeLastFrame, + std::optional blendTime, std::optional restoreTask) { - // bool setPedAnimation ( ped thePed [, string block=nil, string anim=nil, int time=-1, int blend=250, bool loop=true, bool updatePosition=true, bool - // interruptable=true, bool freezeLastFrame = true] ) - CElement* pPed; - SString strBlockName, strAnimName; - int iTime; - int iBlend = 250; - bool bLoop, bUpdatePosition, bInterruptable, bFreezeLastFrame; - bool bDummy; - bool bTaskToBeRestoredOnAnimEnd; - - CScriptArgReader argStream(luaVM); - argStream.ReadUserData(pPed); - if (argStream.NextIsBool()) - argStream.ReadBool(bDummy); // Wiki used setPedAnimation(source,false) as an example - else if (argStream.NextIsNil()) - argStream.m_iIndex++; // Wiki docs said blockName could be nil - else - argStream.ReadString(strBlockName, ""); - argStream.ReadString(strAnimName, ""); - if (argStream.NextCouldBeNumber()) // Freeroam skips the time arg sometimes - argStream.ReadNumber(iTime, -1); - else - iTime = -1; - argStream.ReadBool(bLoop, true); - argStream.ReadBool(bUpdatePosition, true); - argStream.ReadBool(bInterruptable, true); - argStream.ReadBool(bFreezeLastFrame, true); - argStream.ReadNumber(iBlend, 250); - argStream.ReadBool(bTaskToBeRestoredOnAnimEnd, false); + std::string animBlockName; + std::string animationName; - if (!argStream.HasErrors()) + if (blockName.has_value()) { - const char *szBlock, *szAnim; - szBlock = strBlockName.empty() ? NULL : strBlockName.c_str(); - szAnim = strAnimName.empty() ? NULL : strAnimName.c_str(); + if (std::holds_alternative(blockName.value())) + animBlockName = std::get(blockName.value()); + else if (std::holds_alternative(blockName.value())) + if (std::get(blockName.value())) + throw LuaFunctionError("Anim block name cannot be true. Possible values: nil, false, string."); + } - if (CStaticFunctionDefinitions::SetPedAnimation(pPed, szBlock, szAnim, iTime, iBlend, bLoop, bUpdatePosition, bInterruptable, bFreezeLastFrame, - bTaskToBeRestoredOnAnimEnd)) - { - lua_pushboolean(luaVM, true); - return 1; - } + if (animName.has_value()) + { + if (std::holds_alternative(animName.value())) + animationName = std::get(animName.value()); + else if (std::holds_alternative(animName.value())) + if (std::get(animName.value())) + throw LuaFunctionError("Animation name cannot be true. Possible values: nil, false, string."); } - else - m_pScriptDebugging->LogCustom(luaVM, argStream.GetFullErrorMessage()); - lua_pushboolean(luaVM, false); - return 1; + return CStaticFunctionDefinitions::SetPedAnimation(pPed, animBlockName, animationName, time.value_or(-1), blendTime.value_or(250), loop.value_or(true), updatePosition.value_or(true), interruptable.value_or(true), freezeLastFrame.value_or(true), restoreTask.value_or(false)); } int CLuaPedDefs::SetPedAnimationProgress(lua_State* luaVM) diff --git a/Server/mods/deathmatch/logic/luadefs/CLuaPedDefs.h b/Server/mods/deathmatch/logic/luadefs/CLuaPedDefs.h index d458b7a344..0348b5db61 100644 --- a/Server/mods/deathmatch/logic/luadefs/CLuaPedDefs.h +++ b/Server/mods/deathmatch/logic/luadefs/CLuaPedDefs.h @@ -71,7 +71,7 @@ class CLuaPedDefs : public CLuaDefs LUA_DECLARE_OOP(WarpPedIntoVehicle); LUA_DECLARE(RemovePedFromVehicle); LUA_DECLARE(SetPedDoingGangDriveby); - LUA_DECLARE(SetPedAnimation); + static bool SetPedAnimation(CElement* pPed, std::optional> blockName, std::optional> animName, std::optional time, std::optional loop, std::optional updatePosition, std::optional interruptable, std::optional freezeLastFrame, std::optional blendTime, std::optional restoreTask); LUA_DECLARE(SetPedAnimationProgress); LUA_DECLARE(SetPedAnimationSpeed); LUA_DECLARE(SetPedWeaponSlot); diff --git a/Server/mods/deathmatch/logic/luadefs/CLuaResourceDefs.cpp b/Server/mods/deathmatch/logic/luadefs/CLuaResourceDefs.cpp index 57ef2f01e7..baa2dbba46 100644 --- a/Server/mods/deathmatch/logic/luadefs/CLuaResourceDefs.cpp +++ b/Server/mods/deathmatch/logic/luadefs/CLuaResourceDefs.cpp @@ -54,7 +54,7 @@ void CLuaResourceDefs::LoadFunctions() {"getResourceLoadFailureReason", getResourceLoadFailureReason}, {"getResourceLastStartTime", getResourceLastStartTime}, {"getResourceLoadTime", getResourceLoadTime}, - {"getResourceName", getResourceName}, + {"getResourceName", ArgumentParserWarn}, {"getResourceRootElement", getResourceRootElement}, {"getResourceDynamicElementRoot", getResourceDynamicElementRoot}, {"getResourceMapRootElement", getResourceMapRootElement}, @@ -898,23 +898,17 @@ int CLuaResourceDefs::getResourceLoadTime(lua_State* luaVM) return 1; } -int CLuaResourceDefs::getResourceName(lua_State* luaVM) +std::string CLuaResourceDefs::GetResourceName(lua_State* luaVM, std::optional resourceElement) { - CResource* pResource; + if (resourceElement.has_value()) + return (*resourceElement)->GetName(); - CScriptArgReader argStream(luaVM); - argStream.ReadUserData(pResource); + CResource* localResource = &lua_getownerresource(luaVM); - if (!argStream.HasErrors()) - { - lua_pushstring(luaVM, pResource->GetName().c_str()); - return 1; - } - else - m_pScriptDebugging->LogCustom(luaVM, argStream.GetFullErrorMessage()); + if (!localResource) + throw std::invalid_argument("Couldn't find the resource"); - lua_pushboolean(luaVM, false); - return 1; + return localResource->GetName(); } int CLuaResourceDefs::getResourceRootElement(lua_State* luaVM) diff --git a/Server/mods/deathmatch/logic/luadefs/CLuaResourceDefs.h b/Server/mods/deathmatch/logic/luadefs/CLuaResourceDefs.h index 471b7aaef9..29304f402a 100644 --- a/Server/mods/deathmatch/logic/luadefs/CLuaResourceDefs.h +++ b/Server/mods/deathmatch/logic/luadefs/CLuaResourceDefs.h @@ -47,13 +47,14 @@ class CLuaResourceDefs : public CLuaDefs LUA_DECLARE(getResourceLoadFailureReason); LUA_DECLARE(getResourceLastStartTime); LUA_DECLARE(getResourceLoadTime); - LUA_DECLARE(getResourceName); LUA_DECLARE(getResourceRootElement); LUA_DECLARE(getResourceDynamicElementRoot); LUA_DECLARE(getResourceMapRootElement); LUA_DECLARE(getResourceExportedFunctions); LUA_DECLARE(getResourceOrganizationalPath); LUA_DECLARE(isResourceArchived); + + static std::string GetResourceName(lua_State* luaVM, std::optional resourceElement); static bool isResourceProtected(CResource* const resource); // Set stuff diff --git a/Server/mods/deathmatch/logic/packets/CEntityAddPacket.cpp b/Server/mods/deathmatch/logic/packets/CEntityAddPacket.cpp index ff56896864..2502b4cc30 100644 --- a/Server/mods/deathmatch/logic/packets/CEntityAddPacket.cpp +++ b/Server/mods/deathmatch/logic/packets/CEntityAddPacket.cpp @@ -728,11 +728,26 @@ bool CEntityAddPacket::Write(NetBitStreamInterface& BitStream) const position.data.vecPosition = pMarker->GetTarget(); BitStream.Write(&position); + + if (markerType.data.ucType == CMarker::TYPE_CHECKPOINT && BitStream.Can(eBitStreamVersion::SetMarkerTargetArrowProperties)) + { + SColor color = pMarker->GetTargetArrowColor(); + + BitStream.Write(color.R); + BitStream.Write(color.G); + BitStream.Write(color.B); + BitStream.Write(color.A); + BitStream.Write(pMarker->GetTargetArrowSize()); + } } else BitStream.WriteBit(false); } + // Alpha limit + if (BitStream.Can(eBitStreamVersion::Marker_IgnoreAlphaLimits)) + BitStream.WriteBit(pMarker->AreAlphaLimitsIgnored()); + break; } diff --git a/Server/mods/deathmatch/logic/packets/CMapInfoPacket.cpp b/Server/mods/deathmatch/logic/packets/CMapInfoPacket.cpp index 965d998905..e62547b3fb 100644 --- a/Server/mods/deathmatch/logic/packets/CMapInfoPacket.cpp +++ b/Server/mods/deathmatch/logic/packets/CMapInfoPacket.cpp @@ -191,6 +191,7 @@ bool CMapInfoPacket::Write(NetBitStreamInterface& BitStream) const wsProps.data2.fireballdestruct = g_pGame->IsWorldSpecialPropertyEnabled(WorldSpecialProperty::FIREBALLDESTRUCT); wsProps.data3.roadsignstext = g_pGame->IsWorldSpecialPropertyEnabled(WorldSpecialProperty::ROADSIGNSTEXT); wsProps.data4.extendedwatercannons = g_pGame->IsWorldSpecialPropertyEnabled(WorldSpecialProperty::EXTENDEDWATERCANNONS); + wsProps.data5.tunnelweatherblend = g_pGame->IsWorldSpecialPropertyEnabled(WorldSpecialProperty::TUNNELWEATHERBLEND); BitStream.Write(&wsProps); } diff --git a/Shared/data/MTA San Andreas/MTA/locale/en_US/client.pot b/Shared/data/MTA San Andreas/MTA/locale/en_US/client.pot index 18600f065a..b5478fcac8 100644 --- a/Shared/data/MTA San Andreas/MTA/locale/en_US/client.pot +++ b/Shared/data/MTA San Andreas/MTA/locale/en_US/client.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: MTA San Andreas 1.x\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-06-21 20:59+0000\n" +"POT-Creation-Date: 2024-07-15 11:16+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,1352 +18,1415 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" -#. Create buttons -#. OK button -#: Client/gui/CGUIMessageBox_Impl.cpp:64 Client/core/CSettings.cpp:127 -#: Client/core/CSettings.cpp:4785 Client/core/CVersionUpdater.cpp:1607 -#: Client/core/CVersionUpdater.cpp:1823 Client/core/CVersionUpdater.cpp:1916 -#: Client/core/CVersionUpdater.cpp:1938 Client/core/CVersionUpdater.cpp:1956 -#: Client/core/CVersionUpdater.cpp:1968 Client/core/CVersionUpdater.cpp:2120 -#: Client/core/CVersionUpdater.cpp:2129 Client/core/CVersionUpdater.cpp:2138 -#: Client/core/CVersionUpdater.cpp:2152 Client/loader/Dialogs.cpp:133 -msgid "OK" +#: Client/cefweb/CWebsiteRequests.cpp:19 +msgid "Website requests" msgstr "" -#. Cancel button -#: Client/gui/CGUIMessageBox_Impl.cpp:68 Client/core/CSettings.cpp:132 -#: Client/core/CSettings.cpp:4784 Client/core/CVersionUpdater.cpp:1790 -#: Client/core/CVersionUpdater.cpp:1806 Client/core/CVersionUpdater.cpp:1841 -#: Client/mods/deathmatch/logic/CLocalServer.cpp:123 -#: Client/loader/Dialogs.cpp:136 -msgid "Cancel" +#: Client/cefweb/CWebsiteRequests.cpp:27 +msgid "" +"The server requests the following websites in order to load them (later):" msgstr "" -#. ///////////////////////////////////////////////////////////////////////// -#. -#. Dialog strings -#. -#. -#. ///////////////////////////////////////////////////////////////////////// -#: Client/gui/CGUIMessageBox_Impl.cpp:72 Client/core/CSettings.cpp:1389 -#: Client/core/CSettings.cpp:1413 Client/core/CSettings.cpp:4489 -#: Client/core/CSettings.cpp:4563 Client/core/CSettings.cpp:4593 -#: Client/core/CSettings.cpp:4642 Client/core/CQuestionBox.cpp:195 -#: Client/core/CVersionUpdater.cpp:1572 Client/core/CVersionUpdater.cpp:1590 -#: Client/core/CVersionUpdater.cpp:1859 Client/core/CVersionUpdater.cpp:1878 -#: Client/core/CMainMenu.cpp:1200 Client/core/ServerBrowser/CServerInfo.cpp:479 -#: Client/loader/Dialogs.cpp:131 -msgid "Yes" +#: Client/cefweb/CWebsiteRequests.cpp:33 +msgid "NEVER ENTER SENSITIVE DATA TO PROTECT THEM FROM BEING STOLEN" msgstr "" -#: Client/game_sa/CSettingsSA.cpp:753 -msgid "Can't find valid screen resolution." +#: Client/cefweb/CWebsiteRequests.cpp:46 +msgid "Remember decision" msgstr "" -#. Confirm that res should be used -#: Client/game_sa/CSettingsSA.cpp:829 -msgid "Are you sure you want to use this screen resolution?" +#: Client/cefweb/CWebsiteRequests.cpp:51 Client/core/CSettings.cpp:974 +msgid "Allow" msgstr "" -#: Client/game_sa/CSettingsSA.cpp:831 Client/loader/Dialogs.cpp:194 -msgid "MTA: San Andreas" +#: Client/cefweb/CWebsiteRequests.cpp:57 +msgid "Deny" msgstr "" -#. Even the default skin doesn't work, so give up -#: Client/core/CGUI.cpp:86 -msgid "" -"The skin you selected could not be loaded, and the default skin also could " -"not be loaded, please reinstall MTA." +#. Couldn't create render target for CPostEffects +#: Client/multiplayer_sa/CMultiplayerSA_CrashFixHacks.cpp:1450 +msgid "Problem with graphics driver" msgstr "" -#. Show a message that the connection timed out and abort -#. Show failed message and abort the attempt -#. Show timeout message and disconnect -#. Display an error, reset the error status and exit -#: Client/core/CGUI.cpp:87 Client/core/CSettings.cpp:2941 -#: Client/core/CSettings.cpp:4166 Client/core/CSettings.cpp:4194 -#: Client/core/CSettings.cpp:4764 Client/core/CConnectManager.cpp:80 -#: Client/core/CConnectManager.cpp:111 Client/core/CConnectManager.cpp:127 -#: Client/core/CConnectManager.cpp:263 Client/core/CConnectManager.cpp:321 -#: Client/core/CConnectManager.cpp:404 Client/core/CConnectManager.cpp:411 -#: Client/core/CConnectManager.cpp:421 Client/core/CCore.cpp:1275 -#: Client/core/CCore.cpp:1288 Client/core/ServerBrowser/CServerBrowser.cpp:1278 -#: Client/core/ServerBrowser/CServerBrowser.cpp:1300 -#: Client/core/ServerBrowser/CServerBrowser.cpp:1357 -#: Client/core/ServerBrowser/CServerBrowser.cpp:1406 -#: Client/core/DXHook/CDirect3DHook9.cpp:127 -#: Client/mods/deathmatch/logic/CResourceFileDownloadManager.cpp:145 -#: Client/mods/deathmatch/logic/CClientGame.cpp:635 -#: Client/mods/deathmatch/logic/CClientGame.cpp:709 -#: Client/mods/deathmatch/logic/CClientGame.cpp:733 -#: Client/mods/deathmatch/logic/CClientGame.cpp:755 -#: Client/mods/deathmatch/logic/CClientGame.cpp:1168 -#: Client/mods/deathmatch/logic/CClientGame.cpp:1248 -#: Client/mods/deathmatch/logic/CClientGame.cpp:1258 -#: Client/mods/deathmatch/logic/CClientGame.cpp:1327 -#: Client/mods/deathmatch/logic/CClientGame.cpp:1364 -#: Client/mods/deathmatch/logic/CClientGame.cpp:1413 -#: Client/mods/deathmatch/logic/CClientGame.cpp:1425 -#: Client/loader/MainFunctions.cpp:252 Client/loader/MainFunctions.cpp:267 -#: Client/loader/MainFunctions.cpp:269 Client/loader/MainFunctions.cpp:846 -#: Client/loader/CInstallManager.cpp:552 Client/loader/CInstallManager.cpp:561 -#: Shared/mods/deathmatch/logic/CLatentTransferManager.cpp:378 -#: Shared/sdk/SharedUtil.Misc.hpp:137 -msgid "Error" +#: Client/loader/Utils.cpp:534 Client/loader/Dialogs.cpp:890 +msgid "Searching for Grand Theft Auto San Andreas" msgstr "" -#: Client/core/CCredits.cpp:34 -msgid "Programming" +#: Client/loader/Utils.cpp:536 Client/loader/Dialogs.cpp:893 +msgid "Please start Grand Theft Auto San Andreas" msgstr "" -#: Client/core/CCredits.cpp:63 -msgid "Contributors" +#: Client/loader/Utils.cpp:600 +msgid "Select your Grand Theft Auto: San Andreas Installation Directory" msgstr "" -#: Client/core/CCredits.cpp:84 -msgid "Game Design / Scripting" +#: Client/loader/Utils.cpp:968 Client/loader/CInstallManager.cpp:361 +#, c-format +msgid "" +"MTA:SA needs Administrator access for the following task:\n" +"\n" +" '%s'\n" +"\n" +"Please confirm in the next window." msgstr "" -#: Client/core/CCredits.cpp:104 -msgid "Language Localization" +#: Client/loader/Utils.cpp:1069 +#, c-format +msgid "Error loading %s module! (%s)" msgstr "" -#: Client/core/CCredits.cpp:110 -msgid "Patch contributors" +#: Client/loader/Utils.cpp:1394 Client/loader/Dialogs.cpp:914 +msgid "Copying files..." msgstr "" -#: Client/core/CCredits.cpp:234 -msgid "Special Thanks" +#: Client/loader/Utils.cpp:1454 Client/loader/Dialogs.cpp:919 +msgid "Copy finished early. Everything OK." msgstr "" -#: Client/core/CCredits.cpp:265 -msgid "" -"This software and project makes use of the following libraries and software:" +#: Client/loader/Utils.cpp:1460 Client/loader/Dialogs.cpp:924 +msgid "Finishing..." msgstr "" -#: Client/core/CScreenShot.cpp:104 +#: Client/loader/Utils.cpp:1462 Client/loader/Dialogs.cpp:928 +msgid "Done!" +msgstr "" + +#: Client/loader/Utils.cpp:1502 #, c-format -msgid "Screenshot got %d bytes, but expected %d" +msgid "" +"New installation of %s detected.\n" +"\n" +"Do you want to copy your settings from %s ?" msgstr "" -#: Client/core/CScreenShot.cpp:110 -msgid "Screenshot failed" +#: Client/loader/Utils.cpp:1541 +#, c-format +msgid "GTA:SA had trouble opening the file '%s'" msgstr "" -#: Client/core/CScreenShot.cpp:160 +#: Client/loader/Utils.cpp:1563 #, c-format -msgid "Screenshot taken: '%s'" +msgid "GTA:SA is missing the file '%s'." msgstr "" -#. Create the window -#: Client/core/CNewsBrowser.cpp:153 -msgid "NEWS" +#: Client/loader/Utils.cpp:1588 +msgid "GTA:SA had trouble loading a model." msgstr "" -#. News link -#: Client/core/CNewsBrowser.cpp:171 Client/core/CNewsBrowser.cpp:172 -msgid "Visit latest news article" +#: Client/loader/Utils.cpp:1590 +msgid "If you recently modified gta3.img, then try reinstalling GTA:SA." msgstr "" -#: Client/core/CKeyBinds.cpp:186 -msgid "Fire" +#: Client/loader/Utils.cpp:1615 +msgid "GTA:SA had trouble adding an upgrade to a vehicle." msgstr "" -#: Client/core/CKeyBinds.cpp:187 -msgid "Next weapon" +#: Client/loader/Utils.cpp:1634 +#, c-format +msgid "GTA:SA found errors in the file '%s'" msgstr "" -#: Client/core/CKeyBinds.cpp:188 -msgid "Previous weapon" +#: Client/loader/Utils.cpp:1716 +msgid "Did your computer restart when playing MTA:SA?" msgstr "" -#: Client/core/CKeyBinds.cpp:189 -msgid "Forwards" +#: Client/loader/Utils.cpp:1781 +msgid "Please terminate the following programs before continuing:" msgstr "" -#: Client/core/CKeyBinds.cpp:190 -msgid "Backwards" +#. ///////////////////////////////////////////////////////////////////////// +#. +#. Dialog strings +#. +#. +#. ///////////////////////////////////////////////////////////////////////// +#: Client/loader/Dialogs.cpp:131 Client/core/CMainMenu.cpp:1200 +#: Client/core/CQuestionBox.cpp:195 Client/core/CSettings.cpp:1389 +#: Client/core/CSettings.cpp:1413 Client/core/CSettings.cpp:4489 +#: Client/core/CSettings.cpp:4563 Client/core/CSettings.cpp:4593 +#: Client/core/CSettings.cpp:4642 Client/core/CVersionUpdater.cpp:1572 +#: Client/core/CVersionUpdater.cpp:1590 Client/core/CVersionUpdater.cpp:1859 +#: Client/core/CVersionUpdater.cpp:1878 +#: Client/core/ServerBrowser/CServerInfo.cpp:479 +#: Client/gui/CGUIMessageBox_Impl.cpp:72 +msgid "Yes" msgstr "" -#: Client/core/CKeyBinds.cpp:191 Client/core/CSettings.cpp:2240 -#: Client/core/CSettings.cpp:2268 -msgid "Left" +#: Client/loader/Dialogs.cpp:132 Client/core/CMainMenu.cpp:1199 +#: Client/core/CQuestionBox.cpp:194 Client/core/CSettings.cpp:1388 +#: Client/core/CSettings.cpp:1412 Client/core/CSettings.cpp:4488 +#: Client/core/CSettings.cpp:4562 Client/core/CSettings.cpp:4592 +#: Client/core/CSettings.cpp:4641 Client/core/CVersionUpdater.cpp:1571 +#: Client/core/CVersionUpdater.cpp:1589 Client/core/CVersionUpdater.cpp:1858 +#: Client/core/CVersionUpdater.cpp:1877 +#: Client/core/ServerBrowser/CServerInfo.cpp:479 +msgid "No" msgstr "" -#: Client/core/CKeyBinds.cpp:192 Client/core/CSettings.cpp:2242 -#: Client/core/CSettings.cpp:2269 -msgid "Right" +#. Create buttons +#. OK button +#: Client/loader/Dialogs.cpp:133 Client/core/CSettings.cpp:127 +#: Client/core/CSettings.cpp:4785 Client/core/CVersionUpdater.cpp:1607 +#: Client/core/CVersionUpdater.cpp:1823 Client/core/CVersionUpdater.cpp:1916 +#: Client/core/CVersionUpdater.cpp:1938 Client/core/CVersionUpdater.cpp:1956 +#: Client/core/CVersionUpdater.cpp:1968 Client/core/CVersionUpdater.cpp:2120 +#: Client/core/CVersionUpdater.cpp:2129 Client/core/CVersionUpdater.cpp:2138 +#: Client/core/CVersionUpdater.cpp:2152 Client/gui/CGUIMessageBox_Impl.cpp:64 +msgid "OK" msgstr "" -#: Client/core/CKeyBinds.cpp:193 -msgid "Zoom in" +#: Client/loader/Dialogs.cpp:134 +msgid "Quit" msgstr "" -#: Client/core/CKeyBinds.cpp:194 -msgid "Zoom out" +#: Client/loader/Dialogs.cpp:135 +#: Client/core/ServerBrowser/CServerBrowser.cpp:556 +msgid "Help" msgstr "" -#: Client/core/CKeyBinds.cpp:195 -msgid "Enter/Exit" +#. Cancel button +#: Client/loader/Dialogs.cpp:136 +#: Client/mods/deathmatch/logic/CLocalServer.cpp:123 +#: Client/core/CSettings.cpp:132 Client/core/CSettings.cpp:4784 +#: Client/core/CVersionUpdater.cpp:1790 Client/core/CVersionUpdater.cpp:1806 +#: Client/core/CVersionUpdater.cpp:1841 Client/gui/CGUIMessageBox_Impl.cpp:68 +msgid "Cancel" msgstr "" -#: Client/core/CKeyBinds.cpp:196 -msgid "Change camera" +#: Client/loader/Dialogs.cpp:151 +msgid "MTA: San Andreas has encountered a problem" msgstr "" -#. 10 -#: Client/core/CKeyBinds.cpp:197 -msgid "Jump" +#: Client/loader/Dialogs.cpp:152 +msgid "Crash information" msgstr "" -#: Client/core/CKeyBinds.cpp:198 -msgid "Sprint" +#: Client/loader/Dialogs.cpp:153 +msgid "" +"Tick the check box to send this crash info to MTA devs using the 'internet'" msgstr "" -#: Client/core/CKeyBinds.cpp:199 -msgid "Look behind" +#: Client/loader/Dialogs.cpp:154 +msgid "Doing so will increase the chance of this crash being fixed." msgstr "" -#: Client/core/CKeyBinds.cpp:200 -msgid "Crouch" +#: Client/loader/Dialogs.cpp:155 +msgid "Do you want to restart MTA: San Andreas ?" msgstr "" -#: Client/core/CKeyBinds.cpp:201 -msgid "Action" +#: Client/loader/Dialogs.cpp:162 +msgid "MTA: San Andreas - Warning" msgstr "" -#: Client/core/CKeyBinds.cpp:202 -msgid "Walk" +#: Client/loader/Dialogs.cpp:163 +msgid "" +"Your Grand Theft Auto: San Andreas install directory contains these files:" msgstr "" -#: Client/core/CKeyBinds.cpp:203 -msgid "Vehicle fire" +#: Client/loader/Dialogs.cpp:165 +msgid "" +"These files are not required and may interfere with the graphical features " +"in this version of MTA:SA.\n" +"\n" +"It is recommended that you remove or rename these files." msgstr "" -#: Client/core/CKeyBinds.cpp:204 -msgid "Vehicle secondary fire" +#: Client/loader/Dialogs.cpp:167 +msgid "Keep these files, but also show this warning on next start" msgstr "" -#: Client/core/CKeyBinds.cpp:205 -msgid "Vehicle left" +#: Client/loader/Dialogs.cpp:168 +msgid "Do not remind me about these files again" msgstr "" -#: Client/core/CKeyBinds.cpp:206 -msgid "Vehicle right" +#: Client/loader/Dialogs.cpp:169 +msgid "Rename these files from *.dll to *.dll.bak" msgstr "" -#. 20 -#: Client/core/CKeyBinds.cpp:207 -msgid "Steer forwards/down" +#: Client/loader/Dialogs.cpp:170 +msgid "Show me these files" msgstr "" -#: Client/core/CKeyBinds.cpp:208 -msgid "Steer backwards/up" +#: Client/loader/Dialogs.cpp:171 +msgid "Play MTA:SA" msgstr "" -#: Client/core/CKeyBinds.cpp:209 -msgid "Accelerate" +#: Client/loader/Dialogs.cpp:177 +msgid "MTA: San Andreas - Confusing options" msgstr "" -#: Client/core/CKeyBinds.cpp:210 -msgid "Brake/Reverse" +#: Client/loader/Dialogs.cpp:178 +msgid "NVidia Optimus detected!" msgstr "" -#: Client/core/CKeyBinds.cpp:211 -msgid "Radio next" -msgstr "" - -#: Client/core/CKeyBinds.cpp:212 -msgid "Radio previous" -msgstr "" - -#: Client/core/CKeyBinds.cpp:213 -msgid "Radio user track skip" -msgstr "" - -#: Client/core/CKeyBinds.cpp:214 -msgid "Horn" -msgstr "" - -#: Client/core/CKeyBinds.cpp:215 -msgid "Sub-mission" -msgstr "" - -#: Client/core/CKeyBinds.cpp:216 -msgid "Handbrake" -msgstr "" - -#. 30 -#: Client/core/CKeyBinds.cpp:217 -msgid "Vehicle look left" -msgstr "" - -#: Client/core/CKeyBinds.cpp:218 -msgid "Vehicle look right" -msgstr "" - -#: Client/core/CKeyBinds.cpp:219 -msgid "Vehicle look behind" -msgstr "" - -#: Client/core/CKeyBinds.cpp:220 -msgid "Vehicle mouse look" -msgstr "" - -#: Client/core/CKeyBinds.cpp:221 -msgid "Special control left" -msgstr "" - -#: Client/core/CKeyBinds.cpp:222 -msgid "Special control right" -msgstr "" - -#: Client/core/CKeyBinds.cpp:223 -msgid "Special control down" -msgstr "" - -#: Client/core/CKeyBinds.cpp:224 -msgid "Special control up" -msgstr "" - -#: Client/core/CKeyBinds.cpp:225 -msgid "Aim weapon" -msgstr "" - -#: Client/core/CKeyBinds.cpp:226 -msgid "Conversation yes" -msgstr "" - -#. 40 -#: Client/core/CKeyBinds.cpp:227 -msgid "Conversation no" -msgstr "" - -#: Client/core/CKeyBinds.cpp:228 -msgid "Group control forwards" -msgstr "" - -#: Client/core/CKeyBinds.cpp:229 -msgid "Group control backwards" -msgstr "" - -#: Client/core/CJoystickManager.cpp:1578 -msgid "Accelerate Axis" +#: Client/loader/Dialogs.cpp:179 +msgid "Try each option and see what works:" msgstr "" -#: Client/core/CJoystickManager.cpp:1580 -msgid "Brake Axis" +#: Client/loader/Dialogs.cpp:180 +msgid "A - Standard NVidia" msgstr "" -#. Create window (with frame) if it will fit inside the screen resolution -#: Client/core/CSettings.cpp:84 -msgid "SETTINGS" +#: Client/loader/Dialogs.cpp:181 +msgid "B - Alternate NVidia" msgstr "" -#: Client/core/CSettings.cpp:116 -msgid "Multiplayer" +#: Client/loader/Dialogs.cpp:182 +msgid "C - Standard Intel" msgstr "" -#: Client/core/CSettings.cpp:117 -msgid "Video" +#: Client/loader/Dialogs.cpp:183 +msgid "D - Alternate Intel" msgstr "" -#: Client/core/CSettings.cpp:118 -msgid "Audio" +#: Client/loader/Dialogs.cpp:184 +msgid "If you get desperate, this might help:" msgstr "" -#: Client/core/CSettings.cpp:119 -msgid "Binds" +#: Client/loader/Dialogs.cpp:185 +msgid "If you have already selected an option that works, this might help:" msgstr "" -#: Client/core/CSettings.cpp:120 -msgid "Controls" +#: Client/loader/Dialogs.cpp:186 +msgid "Force windowed mode" msgstr "" -#: Client/core/CSettings.cpp:121 -msgid "Interface" +#: Client/loader/Dialogs.cpp:187 +msgid "Don't show again" msgstr "" -#: Client/core/CSettings.cpp:122 -msgid "Web Browser" +#: Client/loader/Dialogs.cpp:194 Client/game_sa/CSettingsSA.cpp:831 +msgid "MTA: San Andreas" msgstr "" -#: Client/core/CSettings.cpp:123 -msgid "Advanced" +#: Client/loader/Dialogs.cpp:195 +msgid "Warning: Could not detect anti-virus product" msgstr "" -#: Client/core/CSettings.cpp:147 Client/core/CSettings.cpp:338 -#: Client/core/CSettings.cpp:617 Client/core/CSettings.cpp:889 -msgid "Load defaults" +#: Client/loader/Dialogs.cpp:197 +msgid "" +"MTA could not detect an anti-virus on your PC.\n" +"\n" +"Viruses interfere with MTA and degrade your gameplay experience.\n" +"\n" +"Press 'Help' for more information." msgstr "" -#. * -#. * Controls tab -#. * -#: Client/core/CSettings.cpp:157 Client/core/CSettings.cpp:181 -msgid "Mouse sensitivity:" +#: Client/loader/Dialogs.cpp:200 +msgid "I have already installed an anti-virus" msgstr "" -#. VerticalAimSensitivity -#: Client/core/CSettings.cpp:157 Client/core/CSettings.cpp:199 -msgid "Vertical aim sensitivity:" +#: Client/loader/Dialogs.cpp:202 +msgid "" +"I will not install an anti-virus.\n" +"I want my PC to lag and be part of a botnet." msgstr "" -#. Mouse Options -#: Client/core/CSettings.cpp:160 -msgid "Mouse options" +#: Client/loader/Dialogs.cpp:901 Client/loader/Install.cpp:852 +msgid "Installing update..." msgstr "" -#: Client/core/CSettings.cpp:167 -msgid "Invert mouse vertically" +#: Client/loader/Dialogs.cpp:909 Client/loader/Install.cpp:934 +msgid "Extracting files..." msgstr "" -#: Client/core/CSettings.cpp:171 -msgid "Steer with mouse" +#: Client/loader/MainFunctions.cpp:248 +msgid "" +"Trouble restarting MTA:SA\n" +"\n" +"If the problem persists, open Task Manager and\n" +"stop the 'gta_sa.exe' and 'Multi Theft Auto.exe' processes\n" +"\n" +"\n" +"Try to launch MTA:SA again?" msgstr "" -#: Client/core/CSettings.cpp:175 -msgid "Fly with mouse" +#. Show timeout message and disconnect +#. Display an error, reset the error status and exit +#. Show a message that the connection timed out and abort +#. Show failed message and abort the attempt +#: Client/loader/MainFunctions.cpp:252 Client/loader/MainFunctions.cpp:267 +#: Client/loader/MainFunctions.cpp:269 Client/loader/MainFunctions.cpp:846 +#: Client/loader/CInstallManager.cpp:552 Client/loader/CInstallManager.cpp:561 +#: Client/mods/deathmatch/logic/CClientGame.cpp:635 +#: Client/mods/deathmatch/logic/CClientGame.cpp:709 +#: Client/mods/deathmatch/logic/CClientGame.cpp:733 +#: Client/mods/deathmatch/logic/CClientGame.cpp:755 +#: Client/mods/deathmatch/logic/CClientGame.cpp:1168 +#: Client/mods/deathmatch/logic/CClientGame.cpp:1248 +#: Client/mods/deathmatch/logic/CClientGame.cpp:1258 +#: Client/mods/deathmatch/logic/CClientGame.cpp:1327 +#: Client/mods/deathmatch/logic/CClientGame.cpp:1364 +#: Client/mods/deathmatch/logic/CClientGame.cpp:1413 +#: Client/mods/deathmatch/logic/CClientGame.cpp:1425 +#: Client/mods/deathmatch/logic/CResourceFileDownloadManager.cpp:145 +#: Client/core/CConnectManager.cpp:80 Client/core/CConnectManager.cpp:111 +#: Client/core/CConnectManager.cpp:127 Client/core/CConnectManager.cpp:263 +#: Client/core/CConnectManager.cpp:321 Client/core/CConnectManager.cpp:404 +#: Client/core/CConnectManager.cpp:411 Client/core/CConnectManager.cpp:421 +#: Client/core/CCore.cpp:1275 Client/core/CCore.cpp:1288 +#: Client/core/CSettings.cpp:2941 Client/core/CSettings.cpp:4166 +#: Client/core/CSettings.cpp:4194 Client/core/CSettings.cpp:4764 +#: Client/core/CGUI.cpp:87 Client/core/DXHook/CDirect3DHook9.cpp:127 +#: Client/core/ServerBrowser/CServerBrowser.cpp:1278 +#: Client/core/ServerBrowser/CServerBrowser.cpp:1300 +#: Client/core/ServerBrowser/CServerBrowser.cpp:1357 +#: Client/core/ServerBrowser/CServerBrowser.cpp:1406 +#: Shared/mods/deathmatch/logic/CLatentTransferManager.cpp:378 +#: Shared/sdk/SharedUtil.Misc.hpp:137 +msgid "Error" msgstr "" -#. Joypad options -#: Client/core/CSettings.cpp:217 -msgid "Joypad options" +#: Client/loader/MainFunctions.cpp:266 +msgid "" +"Another instance of MTA is already running.\n" +"\n" +"If this problem persists, please restart your computer" msgstr "" -#: Client/core/CSettings.cpp:230 -msgid "Standard controls (Mouse + Keyboard)" +#: Client/loader/MainFunctions.cpp:269 +msgid "" +"Another instance of MTA is already running.\n" +"\n" +"Do you want to terminate it?" msgstr "" -#: Client/core/CSettings.cpp:237 -msgid "Classic controls (Joypad)" +#: Client/loader/MainFunctions.cpp:294 +msgid "" +"Are you having problems running MTA:SA?.\n" +"\n" +"Do you want to revert to an earlier version?" msgstr "" -#: Client/core/CSettings.cpp:274 -msgid "Dead Zone" +#: Client/loader/MainFunctions.cpp:324 +msgid "" +"There seems to be a problem launching MTA:SA.\n" +"Resetting GTA settings can sometimes fix this problem.\n" +"\n" +"Do you want to reset GTA settings now?" msgstr "" -#: Client/core/CSettings.cpp:279 -msgid "Saturation" +#: Client/loader/MainFunctions.cpp:339 +msgid "" +"GTA settings have been reset.\n" +"\n" +"Press OK to continue." msgstr "" -#: Client/core/CSettings.cpp:285 -msgid "Use the 'Binds' tab for joypad buttons." +#: Client/loader/MainFunctions.cpp:344 +#, c-format +msgid "File could not be deleted: '%s'" msgstr "" -#: Client/core/CSettings.cpp:324 -msgid "Left Stick" +#. No settings to delete, or can't find them +#: Client/loader/MainFunctions.cpp:352 +msgid "" +"Are you having problems running MTA:SA?.\n" +"\n" +"Do you want to see some online help?" msgstr "" -#: Client/core/CSettings.cpp:330 -msgid "Right Stick" +#. Inform user +#: Client/loader/MainFunctions.cpp:388 +msgid "" +"Are you having problems running MTA:SA?.\n" +"\n" +"Do you want to change the following setting?" msgstr "" -#: Client/core/CSettings.cpp:345 -msgid "DESCRIPTION" +#: Client/loader/MainFunctions.cpp:389 Client/core/CSettings.cpp:662 +#: Client/core/CSettings.cpp:1004 +msgid "Fullscreen mode:" msgstr "" -#: Client/core/CSettings.cpp:346 -msgid "KEY" +#: Client/loader/MainFunctions.cpp:389 Client/core/CSettings.cpp:670 +#: Client/core/CSettings.cpp:1615 +msgid "Borderless window" msgstr "" -#: Client/core/CSettings.cpp:348 -msgid "ALT. KEY" +#: Client/loader/MainFunctions.cpp:431 +msgid "" +"Are you having problems running MTA:SA?.\n" +"\n" +"Try disabling the following products for GTA and MTA:" msgstr "" -#. * -#. * Multiplayer tab -#. * -#: Client/core/CSettings.cpp:353 Client/core/CSettings.cpp:356 -msgid "Nick:" +#: Client/loader/MainFunctions.cpp:465 +msgid "" +"WARNING\n" +"\n" +"MTA:SA has detected unusual activity.\n" +"Please run a virus scan to ensure your system is secure.\n" +"\n" msgstr "" -#: Client/core/CSettings.cpp:378 -msgid "Save server passwords" +#: Client/loader/MainFunctions.cpp:468 +#, c-format +msgid "The detected file was: %s\n" msgstr "" -#: Client/core/CSettings.cpp:383 -msgid "Auto-refresh server browser" +#: Client/loader/MainFunctions.cpp:602 +msgid "" +"An instance of GTA: San Andreas is already running. It needs to be " +"terminated before MTA:SA can be started. Do you want to do that now?" msgstr "" -#: Client/core/CSettings.cpp:388 -msgid "Allow screen upload" +#: Client/loader/MainFunctions.cpp:603 Client/loader/MainFunctions.cpp:610 +#: Client/loader/MainFunctions.cpp:1219 +#: Client/core/ServerBrowser/CServerInfo.cpp:319 +#: Client/core/ServerBrowser/CServerBrowser.cpp:1380 +msgid "Information" msgstr "" -#: Client/core/CSettings.cpp:393 -msgid "Allow external sounds" +#: Client/loader/MainFunctions.cpp:609 +msgid "" +"Unable to terminate GTA: San Andreas. If the problem persists, please " +"restart your computer." msgstr "" -#: Client/core/CSettings.cpp:398 -msgid "Always show download window" +#: Client/loader/MainFunctions.cpp:632 +msgid "" +"Registry entries are missing. Please reinstall Multi Theft Auto: San Andreas." msgstr "" -#: Client/core/CSettings.cpp:403 -msgid "Allow connecting with Discord Rich Presence" +#: Client/loader/MainFunctions.cpp:638 +msgid "" +"The path to your installation of GTA: San Andreas contains unsupported " +"(unicode) characters. Please move your Grand Theft Auto: San Andreas " +"installation to a compatible path that contains only standard ASCII " +"characters and reinstall Multi Theft Auto: San Andreas." msgstr "" -#: Client/core/CSettings.cpp:408 -msgid "Use customized GTA:SA files" +#: Client/loader/MainFunctions.cpp:648 +msgid "" +"The path to your installation of 'MTA:SA' or 'GTA: San Andreas'\n" +"contains a ';' (semicolon).\n" +"\n" +" If you experience problems when running MTA:SA,\n" +" move your installation(s) to a path that does not contain a semicolon." msgstr "" -#: Client/core/CSettings.cpp:413 -msgid "Map rendering options" +#: Client/loader/MainFunctions.cpp:810 +msgid "" +"Load failed. Please ensure that the latest data files have been installed " +"correctly." msgstr "" -#: Client/core/CSettings.cpp:419 Client/core/CSettings.cpp:628 -msgid "Opacity:" +#: Client/loader/MainFunctions.cpp:819 +#, c-format +msgid "Load failed. Please ensure that %s is installed correctly." msgstr "" -#. * -#. * Audio tab -#. * -#: Client/core/CSettings.cpp:439 Client/core/CSettings.cpp:448 -msgid "Master volume:" +#: Client/loader/MainFunctions.cpp:826 +#, c-format +msgid "Load failed. Could not find gta_sa.exe in %s." msgstr "" -#: Client/core/CSettings.cpp:439 Client/core/CSettings.cpp:467 -msgid "Radio volume:" +#: Client/loader/MainFunctions.cpp:836 +#, c-format +msgid "" +"Load failed. %s exists in the GTA directory. Please delete before continuing." msgstr "" -#: Client/core/CSettings.cpp:439 Client/core/CSettings.cpp:486 -msgid "SFX volume:" +#: Client/loader/MainFunctions.cpp:845 +#, c-format +msgid "Main file has an incorrect name (%s)" msgstr "" -#: Client/core/CSettings.cpp:439 Client/core/CSettings.cpp:505 -msgid "MTA volume:" +#: Client/loader/MainFunctions.cpp:856 +msgid "" +"Main file is unsigned. Possible virus activity.\n" +"\n" +"See online help if MTA does not work correctly." msgstr "" -#: Client/core/CSettings.cpp:440 Client/core/CSettings.cpp:524 -msgid "Voice volume:" +#: Client/loader/MainFunctions.cpp:882 +#, c-format +msgid "" +"Data file %s is missing. Possible virus activity.\n" +"\n" +"Consider reinstalling Multi Theft Auto for your security.\n" +"See online help if MTA does not work correctly." msgstr "" -#: Client/core/CSettings.cpp:440 Client/core/CSettings.cpp:565 -msgid "Play mode:" +#: Client/loader/MainFunctions.cpp:893 +#, c-format +msgid "" +"Data file %s is modified. Possible virus activity.\n" +"\n" +"Consider reinstalling Multi Theft Auto for your security.\n" +"See online help if MTA does not work correctly." msgstr "" -#. * -#. * Webbrowser tab -#. * -#: Client/core/CSettings.cpp:442 Client/core/CSettings.cpp:630 -#: Client/core/CSettings.cpp:904 Client/core/CSettings.cpp:2018 -#: Client/mods/deathmatch/logic/CLocalServer.cpp:51 -msgid "General" +#: Client/loader/MainFunctions.cpp:907 +msgid "" +".asi files are in the 'MTA:SA' or 'GTA: San Andreas' installation " +"directory.\n" +"\n" +"Remove these .asi files if you experience problems with MTA:SA." msgstr "" -#: Client/core/CSettings.cpp:543 -msgid "Radio options" +#: Client/loader/MainFunctions.cpp:1009 +msgid "" +"File version mismatch error. Reinstall MTA:SA if you experience problems.\n" msgstr "" -#: Client/core/CSettings.cpp:549 -msgid "Radio Equalizer" +#: Client/loader/MainFunctions.cpp:1018 +msgid "Some files are missing. Reinstall MTA:SA if you experience problems.\n" msgstr "" -#: Client/core/CSettings.cpp:554 -msgid "Radio Auto-tune" +#: Client/loader/MainFunctions.cpp:1030 +msgid "" +"MTA:SA is not compatible with Windows 'Safe Mode'.\n" +"\n" +"Please restart your PC.\n" msgstr "" -#: Client/core/CSettings.cpp:559 -msgid "Usertrack options" +#: Client/loader/MainFunctions.cpp:1123 +msgid "Fix configuration issue" msgstr "" -#: Client/core/CSettings.cpp:573 Client/core/CSettings.cpp:3087 -msgid "Radio" +#. Try to relaunch as admin if not done so already +#: Client/loader/MainFunctions.cpp:1157 +msgid "Fix elevation required error" msgstr "" -#: Client/core/CSettings.cpp:574 Client/core/CSettings.cpp:3089 -msgid "Random" +#: Client/loader/MainFunctions.cpp:1164 +#, c-format +msgid "" +"Could not start Grand Theft Auto: San Andreas. Please try restarting, or if " +"the problem persists,contact MTA at www.multitheftauto.com. \n" +"\n" +"[%s]" msgstr "" -#: Client/core/CSettings.cpp:575 Client/core/CSettings.cpp:3091 -msgid "Sequential" +#: Client/loader/MainFunctions.cpp:1219 +msgid "" +"GTA: San Andreas may not have launched correctly. Do you want to terminate " +"it?" msgstr "" -#: Client/core/CSettings.cpp:578 -msgid "Automatic Media Scan" +#: Client/loader/Install.cpp:265 +msgid "Unknown" msgstr "" -#: Client/core/CSettings.cpp:585 -msgid "Mute options" +#: Client/loader/Install.cpp:272 +#, c-format +msgid "" +"The file '%s' is currently locked by %zu processes.\n" +"\n" +"Do you want to terminate the following processes and continue updating?\n" +"\n" +"%s" msgstr "" -#: Client/core/CSettings.cpp:591 -msgid "Mute All sounds when minimized" +#: Client/loader/Install.cpp:479 +#, c-format +msgid "" +"Your installation may be corrupt now.\n" +"\n" +"%zu out of %zu files could not be restored from the backup.\n" +"\n" +"You should reinstall Multi Theft Auto from www.multitheftauto.com\n" +"or try running the update with administrator rights." msgstr "" -#: Client/core/CSettings.cpp:596 -msgid "Mute Radio sounds when minimized" +#: Client/loader/CInstallManager.cpp:376 +#, c-format +msgid "" +"MTA:SA could not complete the following task:\n" +"\n" +" '%s'\n" msgstr "" -#: Client/core/CSettings.cpp:601 -msgid "Mute SFX sounds when minimized" +#: Client/loader/CInstallManager.cpp:426 +msgid "" +"** The crash was caused by a graphics driver error **\n" +"\n" +"** Please update your graphics drivers **" msgstr "" -#: Client/core/CSettings.cpp:606 -msgid "Mute MTA sounds when minimized" +#: Client/loader/CInstallManager.cpp:532 +msgid "Install updated MTA:SA files" msgstr "" -#: Client/core/CSettings.cpp:611 -msgid "Mute Voice sounds when minimized" +#: Client/loader/CInstallManager.cpp:552 +msgid "" +"Could not update due to file conflicts. Please close other applications and " +"retry" msgstr "" -#. * -#. * Video tab -#. * -#: Client/core/CSettings.cpp:627 Client/core/CSettings.cpp:636 -msgid "Resolution:" +#: Client/loader/CInstallManager.cpp:561 +#, c-format +msgid "Multi Theft Auto has not been installed properly, please reinstall. %s" msgstr "" -#: Client/core/CSettings.cpp:627 Client/core/CSettings.cpp:683 -msgid "FOV:" +#: Client/loader/CInstallManager.cpp:613 +msgid "Create GTA:SA junctions" msgstr "" -#: Client/core/CSettings.cpp:627 Client/core/CSettings.cpp:699 -msgid "Draw Distance:" +#: Client/loader/CInstallManager.cpp:657 +msgid "MTA:SA cannot launch because copying a file failed:" msgstr "" -#: Client/core/CSettings.cpp:627 Client/core/CSettings.cpp:717 -msgid "Brightness:" +#: Client/loader/CInstallManager.cpp:663 Client/loader/CInstallManager.cpp:703 +msgid "MTA:SA cannot launch because an MTA:SA file is incorrect or missing:" msgstr "" -#: Client/core/CSettings.cpp:627 Client/core/CSettings.cpp:735 -msgid "FX Quality:" +#: Client/loader/CInstallManager.cpp:672 +msgid "Copy MTA:SA files" msgstr "" -#: Client/core/CSettings.cpp:628 Client/core/CSettings.cpp:749 -msgid "Anisotropic filtering:" +#: Client/loader/CInstallManager.cpp:695 Client/loader/CInstallManager.cpp:773 +msgid "MTA:SA cannot launch because a GTA:SA file is incorrect or missing:" msgstr "" -#: Client/core/CSettings.cpp:628 Client/core/CSettings.cpp:776 -msgid "Anti-aliasing:" +#: Client/loader/CInstallManager.cpp:780 +msgid "Patch GTA:SA dependency" msgstr "" -#: Client/core/CSettings.cpp:628 Client/core/CSettings.cpp:790 -msgid "Aspect Ratio:" +#: Client/loader/CInstallManager.cpp:828 +msgid "" +"MTA:SA cannot launch because the GTA:SA executable is incorrect or missing:" msgstr "" -#: Client/core/CSettings.cpp:648 -msgid "Windowed" +#: Client/loader/CInstallManager.cpp:832 +msgid "" +"Please check your anti-virus for a false-positive detection, try to add an " +"exception for the GTA:SA executable and restart MTA:SA." msgstr "" -#: Client/core/CSettings.cpp:654 -msgid "DPI aware" +#: Client/loader/CInstallManager.cpp:838 +msgid "Generate GTA:SA" msgstr "" -#: Client/core/CSettings.cpp:662 Client/core/CSettings.cpp:1004 -#: Client/loader/MainFunctions.cpp:389 -msgid "Fullscreen mode:" +#: Client/loader/CInstallManager.cpp:853 +msgid "MTA:SA cannot launch because the GTA:SA executable is not loadable:" msgstr "" -#: Client/core/CSettings.cpp:669 Client/core/CSettings.cpp:1613 -msgid "Standard" +#: Client/loader/CInstallManager.cpp:860 Client/loader/CInstallManager.cpp:883 +msgid "Patch GTA:SA" msgstr "" -#: Client/core/CSettings.cpp:670 Client/core/CSettings.cpp:1615 -#: Client/loader/MainFunctions.cpp:389 -msgid "Borderless window" +#: Client/loader/CInstallManager.cpp:876 +msgid "MTA:SA cannot launch because patching GTA:SA has failed:" msgstr "" -#: Client/core/CSettings.cpp:671 Client/core/CSettings.cpp:1617 -msgid "Borderless keep res" +#: Client/loader/CInstallManager.cpp:1057 Client/core/CCore.cpp:811 +#, c-format +msgid "MTA:SA cannot continue because drive %s does not have enough space." msgstr "" -#: Client/core/CSettings.cpp:675 -msgid "Mip Mapping" +#: Client/loader/CInstallManager.cpp:1113 +msgid "Missing file:" msgstr "" -#: Client/core/CSettings.cpp:743 Client/core/CSettings.cpp:1517 -msgid "Low" +#: Client/loader/CInstallManager.cpp:1117 +msgid "If MTA fails to load, please re-install GTA:SA" msgstr "" -#: Client/core/CSettings.cpp:744 Client/core/CSettings.cpp:1519 -msgid "Medium" +#: Client/loader/CInstallManager.cpp:1152 +msgid "Update install settings" msgstr "" -#: Client/core/CSettings.cpp:745 Client/core/CSettings.cpp:1086 -#: Client/core/CSettings.cpp:1521 Client/core/CSettings.cpp:3145 -msgid "High" +#: Client/loader/CInstallManager.cpp:1305 +msgid "Update compatibility settings" msgstr "" -#: Client/core/CSettings.cpp:746 Client/core/CSettings.cpp:1523 -msgid "Very high" +#: Client/game_sa/CSettingsSA.cpp:753 +msgid "Can't find valid screen resolution." msgstr "" -#: Client/core/CSettings.cpp:761 Client/core/CSettings.cpp:784 -#: Client/core/CSettings.cpp:1017 Client/core/CSettings.cpp:1071 -#: Client/core/CSettings.cpp:1201 Client/core/CSettings.cpp:1527 -#: Client/core/CSettings.cpp:3152 Client/core/CSettings.cpp:3184 -#: Client/core/CSettings.cpp:3206 Client/core/CSettings.cpp:4234 -msgid "Off" +#. Confirm that res should be used +#: Client/game_sa/CSettingsSA.cpp:829 +msgid "Are you sure you want to use this screen resolution?" msgstr "" -#: Client/core/CSettings.cpp:785 Client/core/CSettings.cpp:1529 -msgid "1x" +#: Client/mods/deathmatch/CClient.cpp:36 +msgid "This version has expired." msgstr "" -#: Client/core/CSettings.cpp:786 Client/core/CSettings.cpp:1531 -msgid "2x" +#: Client/mods/deathmatch/CClient.cpp:56 +msgid "disconnect from the game" msgstr "" -#: Client/core/CSettings.cpp:787 Client/core/CSettings.cpp:1533 -msgid "3x" +#: Client/mods/deathmatch/CClient.cpp:57 +msgid "shows the nametags" msgstr "" -#: Client/core/CSettings.cpp:800 Client/core/CSettings.cpp:1019 -#: Client/core/CSettings.cpp:1539 Client/core/CSettings.cpp:3154 -msgid "Auto" +#: Client/mods/deathmatch/CClient.cpp:58 +msgid "shows the chatbox" msgstr "" -#: Client/core/CSettings.cpp:801 Client/core/CSettings.cpp:1541 -msgid "4:3" +#: Client/mods/deathmatch/CClient.cpp:59 +msgid "shows the network statistics" msgstr "" -#: Client/core/CSettings.cpp:802 Client/core/CSettings.cpp:1543 -msgid "16:10" +#. Key commands (registered as 'mod commands', can be disabled) +#: Client/mods/deathmatch/CClient.cpp:62 +msgid "open the chat input" msgstr "" -#: Client/core/CSettings.cpp:803 Client/core/CSettings.cpp:1545 -msgid "16:9" +#: Client/mods/deathmatch/CClient.cpp:63 +msgid "transmits voice to other players" msgstr "" -#: Client/core/CSettings.cpp:806 -msgid "HUD Match Aspect Ratio" +#: Client/mods/deathmatch/CClient.cpp:64 +msgid "enters a car as passenger" msgstr "" -#: Client/core/CSettings.cpp:812 -msgid "Volumetric Shadows" +#: Client/mods/deathmatch/CClient.cpp:65 +msgid "next radio channel" msgstr "" -#: Client/core/CSettings.cpp:816 -msgid "Grass effect" +#: Client/mods/deathmatch/CClient.cpp:66 +msgid "previous radio channel" msgstr "" -#: Client/core/CSettings.cpp:820 -msgid "Heat haze" +#: Client/mods/deathmatch/CClient.cpp:67 +msgid "enables the radar view" msgstr "" -#: Client/core/CSettings.cpp:824 -msgid "Tyre Smoke etc" +#: Client/mods/deathmatch/CClient.cpp:68 +msgid "zooms the radar in" msgstr "" -#: Client/core/CSettings.cpp:828 -msgid "Dynamic ped shadows" +#: Client/mods/deathmatch/CClient.cpp:69 +msgid "zooms the radar out" msgstr "" -#: Client/core/CSettings.cpp:832 -msgid "Motion blur" +#: Client/mods/deathmatch/CClient.cpp:70 +msgid "moves the radar north" msgstr "" -#: Client/core/CSettings.cpp:837 -msgid "Full Screen Minimize" +#: Client/mods/deathmatch/CClient.cpp:71 +msgid "moves the radar south" msgstr "" -#: Client/core/CSettings.cpp:849 -msgid "Enable Device Selection Dialog" +#: Client/mods/deathmatch/CClient.cpp:72 +msgid "moves the radar east" msgstr "" -#: Client/core/CSettings.cpp:861 -msgid "Show unsafe resolutions" +#: Client/mods/deathmatch/CClient.cpp:73 +msgid "moves the radar west" msgstr "" -#: Client/core/CSettings.cpp:873 -msgid "Render vehicles always in high detail" +#: Client/mods/deathmatch/CClient.cpp:74 +msgid "attaches the radar" msgstr "" -#: Client/core/CSettings.cpp:877 -msgid "Render peds always in high detail" +#: Client/mods/deathmatch/CClient.cpp:75 +msgid "reduces radar opacity" msgstr "" -#: Client/core/CSettings.cpp:881 -msgid "Corona rain reflections" +#: Client/mods/deathmatch/CClient.cpp:76 +msgid "increases radar opacity" msgstr "" -#: Client/core/CSettings.cpp:910 -msgid "Enable remote websites" +#: Client/mods/deathmatch/CClient.cpp:77 +msgid "toggles radar help text" msgstr "" -#: Client/core/CSettings.cpp:915 -msgid "Enable Javascript on remote websites" +#: Client/mods/deathmatch/CClient.cpp:78 +msgid "sends a message to the targetted player" msgstr "" -#: Client/core/CSettings.cpp:920 -msgid "Custom blacklist" +#: Client/mods/deathmatch/CClient.cpp:79 +msgid "changes to the next weapon whilst in a vehicle" msgstr "" -#: Client/core/CSettings.cpp:931 Client/core/CSettings.cpp:966 -msgid "Enter a domain e.g. google.com" +#: Client/mods/deathmatch/CClient.cpp:80 +msgid "changes to the previous weapon whilst in a vehicle" msgstr "" -#: Client/core/CSettings.cpp:939 -msgid "Block" +#: Client/mods/deathmatch/CClient.cpp:81 +msgid "outputs info about the current server" msgstr "" -#: Client/core/CSettings.cpp:947 Client/core/CSettings.cpp:982 -msgid "Domain" +#. ACHTUNG" Should this be handled by the atomic cvar setter? +#: Client/mods/deathmatch/CClient.cpp:84 +msgid "defines the scale multiplier of all text-displays" msgstr "" -#: Client/core/CSettings.cpp:949 Client/core/CSettings.cpp:984 -msgid "Remove domain" +#. Development mode +#: Client/mods/deathmatch/CClient.cpp:91 +msgid "(Development mode) shows the colshapes" msgstr "" -#. Reset vecTemp -#: Client/core/CSettings.cpp:955 -msgid "Custom whitelist" +#: Client/mods/deathmatch/CClient.cpp:92 +msgid "(Development mode) prints world sound ids into the debug window" msgstr "" -#: Client/core/CSettings.cpp:974 Client/cefweb/CWebsiteRequests.cpp:51 -msgid "Allow" +#: Client/mods/deathmatch/logic/CTransferBox.cpp:25 +msgid "Map download progress:" msgstr "" -#. Misc section label -#: Client/core/CSettings.cpp:997 -msgid "Misc" +#: Client/mods/deathmatch/logic/CTransferBox.cpp:28 +msgid "Download Progress:" msgstr "" -#. Fast clothes loading -#: Client/core/CSettings.cpp:1003 Client/core/CSettings.cpp:1010 -#: Client/core/CSettings.cpp:4803 -msgid "Fast CJ clothes loading:" +#. Find our largest piece of text, so we can size accordingly +#: Client/mods/deathmatch/logic/CTransferBox.cpp:42 +#: Client/mods/deathmatch/logic/CTransferBox.cpp:105 +#, c-format +msgid "%s of %s" msgstr "" -#. Browser scan speed -#: Client/core/CSettings.cpp:1003 Client/core/CSettings.cpp:1024 -#: Client/core/CSettings.cpp:4805 -msgid "Browser speed:" +#: Client/mods/deathmatch/logic/CTransferBox.cpp:44 +#: Client/mods/deathmatch/logic/CTransferBox.cpp:65 +msgid "Disconnect to cancel download" msgstr "" -#. Single download -#: Client/core/CSettings.cpp:1003 Client/core/CSettings.cpp:1038 -#: Client/core/CSettings.cpp:4807 -msgid "Single connection:" +#: Client/mods/deathmatch/logic/CResource.cpp:372 +#: Client/mods/deathmatch/logic/CClientGame.cpp:1083 Client/core/CCore.cpp:674 +#: Client/core/CSettings.cpp:3483 +msgid "In-game" msgstr "" -#. Packet tag -#: Client/core/CSettings.cpp:1003 Client/core/CSettings.cpp:1051 -#: Client/core/CSettings.cpp:4809 -msgid "Packet tag:" +#: Client/mods/deathmatch/logic/CLocalServer.cpp:37 +msgid "HOST GAME" msgstr "" -#. Progress animation -#: Client/core/CSettings.cpp:1004 Client/core/CSettings.cpp:1064 -#: Client/core/CSettings.cpp:4811 -msgid "Progress animation:" +#. * +#. * Webbrowser tab +#. * +#: Client/mods/deathmatch/logic/CLocalServer.cpp:51 +#: Client/core/CSettings.cpp:442 Client/core/CSettings.cpp:630 +#: Client/core/CSettings.cpp:904 Client/core/CSettings.cpp:2018 +msgid "General" msgstr "" -#. Process priority -#: Client/core/CSettings.cpp:1004 Client/core/CSettings.cpp:1077 -#: Client/core/CSettings.cpp:4801 -msgid "Process priority:" +#. m_pTabs->CreateTab ( "Gamemode" ); +#: Client/mods/deathmatch/logic/CLocalServer.cpp:53 +msgid "Resources" msgstr "" -#. Debug setting -#: Client/core/CSettings.cpp:1004 Client/core/CSettings.cpp:1091 -#: Client/core/CSettings.cpp:4813 -msgid "Debug setting:" +#: Client/mods/deathmatch/logic/CLocalServer.cpp:55 +#: Client/mods/deathmatch/logic/CLocalServer.cpp:57 +msgid "Server name:" msgstr "" -#. Streaming memory -#: Client/core/CSettings.cpp:1005 Client/core/CSettings.cpp:1114 -#: Client/core/CSettings.cpp:4815 -msgid "Streaming memory:" +#: Client/mods/deathmatch/logic/CLocalServer.cpp:64 +#: Client/mods/deathmatch/logic/CLocalServer.cpp:66 +msgid "Password:" msgstr "" -#. Update build type -#: Client/core/CSettings.cpp:1005 Client/core/CSettings.cpp:1215 -msgid "Update build type:" +#: Client/mods/deathmatch/logic/CLocalServer.cpp:73 +#: Client/mods/deathmatch/logic/CLocalServer.cpp:75 +msgid "Max players:" msgstr "" -#. UpdateAutoInstall -#: Client/core/CSettings.cpp:1005 Client/core/CSettings.cpp:1194 -msgid "Install important updates:" +#: Client/mods/deathmatch/logic/CLocalServer.cpp:82 +#: Client/mods/deathmatch/logic/CLocalServer.cpp:84 +msgid "Broadcast:" msgstr "" -#: Client/core/CSettings.cpp:1018 Client/core/CSettings.cpp:1046 -#: Client/core/CSettings.cpp:1059 Client/core/CSettings.cpp:3156 -#: Client/core/CSettings.cpp:3172 Client/core/CSettings.cpp:3179 -msgid "On" +#: Client/mods/deathmatch/logic/CLocalServer.cpp:86 +msgid "LAN" msgstr "" -#: Client/core/CSettings.cpp:1031 Client/core/CSettings.cpp:3161 -msgid "Very slow" +#. Create the tabs +#: Client/mods/deathmatch/logic/CLocalServer.cpp:90 +#: Client/core/ServerBrowser/CServerBrowser.cpp:133 +msgid "Internet" msgstr "" -#: Client/core/CSettings.cpp:1032 Client/core/CSettings.cpp:1045 -#: Client/core/CSettings.cpp:1058 Client/core/CSettings.cpp:1072 -#: Client/core/CSettings.cpp:1098 Client/core/CSettings.cpp:1110 -#: Client/core/CSettings.cpp:1202 Client/core/CSettings.cpp:1222 -#: Client/core/CSettings.cpp:3163 Client/core/CSettings.cpp:3170 -#: Client/core/CSettings.cpp:3177 Client/core/CSettings.cpp:3186 -#: Client/core/CSettings.cpp:3199 -msgid "Default" +#: Client/mods/deathmatch/logic/CLocalServer.cpp:99 +msgid "Selected" msgstr "" -#: Client/core/CSettings.cpp:1033 Client/core/CSettings.cpp:3165 -msgid "Fast" +#: Client/mods/deathmatch/logic/CLocalServer.cpp:116 +msgid "All" msgstr "" -#: Client/core/CSettings.cpp:1084 Client/core/CSettings.cpp:3141 -msgid "Normal" +#: Client/mods/deathmatch/logic/CLocalServer.cpp:118 +msgid "Start" msgstr "" -#: Client/core/CSettings.cpp:1085 Client/core/CSettings.cpp:3143 -msgid "Above normal" +#: Client/mods/deathmatch/logic/CClientGame.cpp:369 +msgid "Flying a UFO around" msgstr "" -#: Client/core/CSettings.cpp:1121 -msgid "Min" +#: Client/mods/deathmatch/logic/CClientGame.cpp:369 +msgid "Cruising around" msgstr "" - -#: Client/core/CSettings.cpp:1134 -msgid "Max" + +#: Client/mods/deathmatch/logic/CClientGame.cpp:369 +msgid "Riding the waves of" msgstr "" -#. Windows 8 compatibility -#: Client/core/CSettings.cpp:1141 -msgid "Windows 8 compatibility:" +#: Client/mods/deathmatch/logic/CClientGame.cpp:370 +msgid "Riding the train in" msgstr "" -#: Client/core/CSettings.cpp:1145 -msgid "16-bit color" +#: Client/mods/deathmatch/logic/CClientGame.cpp:370 +msgid "Flying around" msgstr "" -#: Client/core/CSettings.cpp:1150 -msgid "Mouse fix" +#: Client/mods/deathmatch/logic/CClientGame.cpp:371 +msgid "Riding around" msgstr "" -#. Cache path info -#: Client/core/CSettings.cpp:1168 -msgid "Client resource files:" +#: Client/mods/deathmatch/logic/CClientGame.cpp:371 +msgid "Monster truckin' around" msgstr "" -#: Client/core/CSettings.cpp:1172 -msgid "Show in Explorer" +#: Client/mods/deathmatch/logic/CClientGame.cpp:371 +msgid "Quaddin' around" msgstr "" -#. Auto updater section label -#: Client/core/CSettings.cpp:1187 Client/core/CSettings.cpp:1190 -msgid "Auto updater" +#: Client/mods/deathmatch/logic/CClientGame.cpp:372 +msgid "Bunny hopping around" msgstr "" -#. Check for updates -#: Client/core/CSettings.cpp:1228 -msgid "Check for update now" +#: Client/mods/deathmatch/logic/CClientGame.cpp:372 +msgid "Doing weird stuff in" msgstr "" -#: Client/core/CSettings.cpp:1382 -msgid "Some settings will be changed when you next start MTA" +#: Client/mods/deathmatch/logic/CClientGame.cpp:376 +msgid "Climbing around in" msgstr "" -#: Client/core/CSettings.cpp:1383 -msgid "" -"\n" -"\n" -"Do you want to restart now?" +#: Client/mods/deathmatch/logic/CClientGame.cpp:377 +#: Client/mods/deathmatch/logic/CClientGame.cpp:378 +msgid "Doing a drive-by in" msgstr "" -#: Client/core/CSettings.cpp:1386 -msgid "RESTART REQUIRED" +#: Client/mods/deathmatch/logic/CClientGame.cpp:379 +msgid "Blub blub..." msgstr "" -#: Client/core/CSettings.cpp:1388 Client/core/CSettings.cpp:1412 -#: Client/core/CSettings.cpp:4488 Client/core/CSettings.cpp:4562 -#: Client/core/CSettings.cpp:4592 Client/core/CSettings.cpp:4641 -#: Client/core/CQuestionBox.cpp:194 Client/core/CVersionUpdater.cpp:1571 -#: Client/core/CVersionUpdater.cpp:1589 Client/core/CVersionUpdater.cpp:1858 -#: Client/core/CVersionUpdater.cpp:1877 Client/core/CMainMenu.cpp:1199 -#: Client/core/ServerBrowser/CServerInfo.cpp:479 Client/loader/Dialogs.cpp:132 -msgid "No" +#: Client/mods/deathmatch/logic/CClientGame.cpp:380 +msgid "Breathing water" msgstr "" -#: Client/core/CSettings.cpp:1406 -msgid "Some settings will be changed when you disconnect the current server" +#: Client/mods/deathmatch/logic/CClientGame.cpp:381 +msgid "Drowning in" msgstr "" -#: Client/core/CSettings.cpp:1407 -msgid "" -"\n" -"\n" -"Do you want to disconnect now?" +#: Client/mods/deathmatch/logic/CClientGame.cpp:382 +msgid "Ducking for cover in" msgstr "" -#: Client/core/CSettings.cpp:1410 -msgid "DISCONNECT REQUIRED" +#: Client/mods/deathmatch/logic/CClientGame.cpp:383 +msgid "Fighting in" msgstr "" -#. Update the joystick name -#: Client/core/CSettings.cpp:1737 -msgid "Joypad not detected - Check connections and restart game" +#: Client/mods/deathmatch/logic/CClientGame.cpp:384 +msgid "Throwing fists in" msgstr "" -#: Client/core/CSettings.cpp:1932 -msgid "Binding axis" +#: Client/mods/deathmatch/logic/CClientGame.cpp:385 +msgid "Blastin' fools in" msgstr "" -#: Client/core/CSettings.cpp:1932 -msgid "Move an axis to bind, or escape to clear" +#: Client/mods/deathmatch/logic/CClientGame.cpp:386 +msgid "Shooting up" msgstr "" -#: Client/core/CSettings.cpp:2009 -msgid "Language:" +#: Client/mods/deathmatch/logic/CClientGame.cpp:387 +msgid "Jetpacking in" msgstr "" -#: Client/core/CSettings.cpp:2009 -msgid "Skin:" +#: Client/mods/deathmatch/logic/CClientGame.cpp:388 +msgid "Literally on fire in" msgstr "" -#: Client/core/CSettings.cpp:2009 -msgid "Presets:" +#: Client/mods/deathmatch/logic/CClientGame.cpp:389 +msgid "Burning up in" msgstr "" -#: Client/core/CSettings.cpp:2058 -msgid "Chat" +#: Client/mods/deathmatch/logic/CClientGame.cpp:390 +msgid "Swimming in" msgstr "" -#: Client/core/CSettings.cpp:2075 -msgid "Load" +#: Client/mods/deathmatch/logic/CClientGame.cpp:391 +msgid "Floating around in" msgstr "" -#: Client/core/CSettings.cpp:2087 -msgid "Colors" +#: Client/mods/deathmatch/logic/CClientGame.cpp:392 +msgid "Being chased by a shark" msgstr "" -#: Client/core/CSettings.cpp:2088 -msgid "Layout" +#: Client/mods/deathmatch/logic/CClientGame.cpp:393 +msgid "Choking to death in" msgstr "" -#: Client/core/CSettings.cpp:2089 Client/core/CSettings.cpp:2335 -msgid "Options" +#: Client/mods/deathmatch/logic/CClientGame.cpp:527 +#: Client/core/CMainMenu.cpp:304 Client/core/CCore.cpp:674 +#: Client/core/CSettings.cpp:3479 +msgid "Main menu" msgstr "" -#: Client/core/CSettings.cpp:2095 -msgid "Chat Background" +#: Client/mods/deathmatch/logic/CClientGame.cpp:635 +#: Client/mods/deathmatch/logic/CClientGame.cpp:733 +#: Client/core/ServerBrowser/CServerBrowser.cpp:1300 +#: Client/core/ServerBrowser/CServerBrowser.cpp:1357 +msgid "Invalid nickname! Please go to Settings and set a new one!" msgstr "" -#: Client/core/CSettings.cpp:2095 -msgid "Chat Text" +#. Display the status box +#: Client/mods/deathmatch/logic/CClientGame.cpp:651 +#: Client/core/CConnectManager.cpp:148 +msgid "CONNECTING" msgstr "" -#: Client/core/CSettings.cpp:2095 -msgid "Input Background" +#: Client/mods/deathmatch/logic/CClientGame.cpp:651 +msgid "Entering the game ..." msgstr "" -#: Client/core/CSettings.cpp:2095 -msgid "Input Text" +#: Client/mods/deathmatch/logic/CClientGame.cpp:709 +msgid "" +"Not connected; please use Quick Connect or the 'connect' command to connect " +"to a server." msgstr "" -#: Client/core/CSettings.cpp:2118 -msgid "Lines:" +#: Client/mods/deathmatch/logic/CClientGame.cpp:755 +msgid "Could not start the local server. See console for details." msgstr "" -#: Client/core/CSettings.cpp:2118 -msgid "Scale:" +#: Client/mods/deathmatch/logic/CClientGame.cpp:765 +#: Client/mods/deathmatch/logic/CClientGame.cpp:1237 +msgid "Local Server" msgstr "" -#: Client/core/CSettings.cpp:2118 -msgid "Width:" +#: Client/mods/deathmatch/logic/CClientGame.cpp:765 +msgid "Starting local server ..." msgstr "" -#: Client/core/CSettings.cpp:2121 -msgid "Size" +#: Client/mods/deathmatch/logic/CClientGame.cpp:1013 +msgid "Area 51" msgstr "" -#: Client/core/CSettings.cpp:2170 -msgid "after" +#: Client/mods/deathmatch/logic/CClientGame.cpp:1022 +msgid "Walking around " msgstr "" -#: Client/core/CSettings.cpp:2170 -msgid "for" +#: Client/mods/deathmatch/logic/CClientGame.cpp:1168 +#, c-format +msgid "You were kicked from the game ( %s )" msgstr "" -#: Client/core/CSettings.cpp:2170 -msgid "sec" +#: Client/mods/deathmatch/logic/CClientGame.cpp:1237 +msgid "Connecting to local server..." msgstr "" -#: Client/core/CSettings.cpp:2173 -msgid "Fading" +#: Client/mods/deathmatch/logic/CClientGame.cpp:1248 +msgid "Error connecting to server." msgstr "" -#: Client/core/CSettings.cpp:2179 -msgid "Fade out old lines" +#: Client/mods/deathmatch/logic/CClientGame.cpp:1258 +msgid "Connecting to local server timed out. See console for details." msgstr "" -#: Client/core/CSettings.cpp:2219 -msgid "Horizontal:" +#: Client/mods/deathmatch/logic/CClientGame.cpp:1327 +#: Client/core/CConnectManager.cpp:263 +msgid "Connection timed out" msgstr "" -#: Client/core/CSettings.cpp:2219 -msgid "Vertical:" +#: Client/mods/deathmatch/logic/CClientGame.cpp:1364 +msgid "Connection with the server was lost" msgstr "" -#: Client/core/CSettings.cpp:2219 -msgid "Text-Align:" +#: Client/mods/deathmatch/logic/CClientGame.cpp:1375 +#: Client/core/CConnectManager.cpp:277 Client/core/CConnectManager.cpp:281 +msgid "Disconnected: unknown protocol error" msgstr "" -#: Client/core/CSettings.cpp:2219 -msgid "X-Offset:" +#: Client/mods/deathmatch/logic/CClientGame.cpp:1379 +#: Client/core/CConnectManager.cpp:285 +msgid "Disconnected: disconnected remotely" msgstr "" -#: Client/core/CSettings.cpp:2220 -msgid "Y-Offset:" +#: Client/mods/deathmatch/logic/CClientGame.cpp:1383 +#: Client/core/CConnectManager.cpp:289 +msgid "Disconnected: connection lost remotely" msgstr "" -#: Client/core/CSettings.cpp:2226 -msgid "Position" +#: Client/mods/deathmatch/logic/CClientGame.cpp:1387 +#: Client/core/CConnectManager.cpp:293 +msgid "Disconnected: you are banned from this server" msgstr "" -#: Client/core/CSettings.cpp:2241 Client/core/CSettings.cpp:2255 -msgid "Center" +#: Client/mods/deathmatch/logic/CClientGame.cpp:1391 +msgid "Disconnected: the server is currently full" msgstr "" -#: Client/core/CSettings.cpp:2254 -msgid "Top" +#: Client/mods/deathmatch/logic/CClientGame.cpp:1395 +#: Client/core/CConnectManager.cpp:300 +msgid "Disconnected: disconnected from the server" msgstr "" -#: Client/core/CSettings.cpp:2256 -msgid "Bottom" +#: Client/mods/deathmatch/logic/CClientGame.cpp:1399 +#: Client/core/CConnectManager.cpp:304 +msgid "Disconnected: connection to the server was lost" msgstr "" -#: Client/core/CSettings.cpp:2304 -msgid "Font" +#: Client/mods/deathmatch/logic/CClientGame.cpp:1403 +msgid "Disconnected: invalid password specified" msgstr "" -#: Client/core/CSettings.cpp:2341 -msgid "Hide background when not typing" +#: Client/mods/deathmatch/logic/CClientGame.cpp:1407 +#: Client/core/CConnectManager.cpp:311 +msgid "Disconnected: connection was refused" msgstr "" -#: Client/core/CSettings.cpp:2346 -msgid "Nickname completion using the \"Tab\" key" +#: Client/mods/deathmatch/logic/CClientGame.cpp:1425 +msgid "MTA Client verification failed!" msgstr "" -#: Client/core/CSettings.cpp:2351 -msgid "Allow server to flash the window" +#: Client/mods/deathmatch/logic/CClientGame.cpp:5707 +msgid "In a ditch" msgstr "" -#: Client/core/CSettings.cpp:2356 -msgid "Allow tray balloon notifications" +#: Client/mods/deathmatch/logic/CClientGame.cpp:5707 +msgid "En-route to hospital" msgstr "" -#: Client/core/CSettings.cpp:2361 -msgid "Chat text black/white outline" +#: Client/mods/deathmatch/logic/CClientGame.cpp:5707 +msgid "Meeting their maker" msgstr "" -#. Create a messagebox to notify the user -#. SString strText = SString::Printf ( "Press a key to bind to '%s'", pItemBind->GetText ().c_str () ); -#. Create a messagebox to notify the user -#. sSString strText = SString::Printf ( "Press a key to bind to '%s'", pItemBind->GetText ().c_str () ); -#: Client/core/CSettings.cpp:2610 Client/core/CSettings.cpp:2617 -msgid "Press a key to bind, or escape to clear" +#: Client/mods/deathmatch/logic/CClientGame.cpp:5708 +msgid "Regretting their decisions" msgstr "" -#: Client/core/CSettings.cpp:2611 -msgid "Binding a primary key" +#: Client/mods/deathmatch/logic/CClientGame.cpp:5708 +msgid "Wasted" msgstr "" -#: Client/core/CSettings.cpp:2618 -msgid "Binding a secondary key" +#. Throw the error and disconnect +#: Client/mods/deathmatch/logic/CResourceFileDownloadManager.cpp:141 +#, c-format +msgid "Download error: %s" msgstr "" -#: Client/core/CSettings.cpp:2694 -msgid "GTA GAME CONTROLS" +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:506 +msgid "Disconnected: Invalid nickname" msgstr "" -#: Client/core/CSettings.cpp:2696 -msgid "MULTIPLAYER CONTROLS" +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:510 +msgid "Disconnect from server" msgstr "" -#: Client/core/CSettings.cpp:2941 Client/core/CSettings.cpp:4764 -msgid "Your nickname contains invalid characters!" +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:514 +#, c-format +msgid "" +"Disconnected: Serial is banned.\n" +"Reason: %s" msgstr "" -#: Client/core/CSettings.cpp:3479 Client/core/CCore.cpp:674 -#: Client/core/CMainMenu.cpp:304 -#: Client/mods/deathmatch/logic/CClientGame.cpp:527 -msgid "Main menu" +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:520 +#, c-format +msgid "" +"Disconnected: You are banned.\n" +"Reason: %s" msgstr "" -#: Client/core/CSettings.cpp:3483 Client/core/CCore.cpp:674 -#: Client/mods/deathmatch/logic/CClientGame.cpp:1083 -#: Client/mods/deathmatch/logic/CResource.cpp:372 -msgid "In-game" +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:526 +#, c-format +msgid "" +"Disconnected: Account is banned.\n" +"Reason: %s" msgstr "" -#: Client/core/CSettings.cpp:3778 -msgid "Red:" +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:531 +msgid "Disconnected: Version mismatch" msgstr "" -#: Client/core/CSettings.cpp:3778 -msgid "Green:" +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:535 +msgid "Disconnected: Join flood. Please wait a minute, then reconnect." msgstr "" -#: Client/core/CSettings.cpp:3778 -msgid "Blue:" +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:539 +#, c-format +msgid "" +"Disconnected: Server from different branch.\n" +"Information: %s" msgstr "" -#: Client/core/CSettings.cpp:3778 -msgid "Transparency:" +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:544 +#, c-format +msgid "" +"Disconnected: Bad version.\n" +"Information: %s" msgstr "" -#: Client/core/CSettings.cpp:3781 -msgid "Color" +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:549 +#, c-format +msgid "" +"Disconnected: Server is running a newer build.\n" +"Information: %s" msgstr "" -#: Client/core/CSettings.cpp:3858 -msgid "Preview" +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:554 +#, c-format +msgid "" +"Disconnected: Server is running an older build.\n" +"Information: %s" msgstr "" -#: Client/core/CSettings.cpp:4166 -msgid "Please disconnect before changing language" +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:559 +msgid "Disconnected: Nick already in use" msgstr "" -#: Client/core/CSettings.cpp:4194 -msgid "Please disconnect before changing skin" +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:563 +msgid "Disconnected: Player element could not be created." msgstr "" -#: Client/core/CSettings.cpp:4482 -msgid "" -"Volmetric shadows can cause some systems to slow down.\n" -"\n" -"Are you sure you want to enable them?" +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:567 +#, c-format +msgid "Disconnected: Server refused the connection: %s" msgstr "" -#: Client/core/CSettings.cpp:4486 -msgid "PERFORMANCE WARNING" +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:572 +msgid "Disconnected: Serial verification failed" msgstr "" -#: Client/core/CSettings.cpp:4506 -msgid "" -"Screen upload is required by some servers for anti-cheat purposes.\n" -"\n" -"(The chat box and GUI is excluded from the upload)\n" +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:576 +#, c-format +msgid "Disconnected: Connection desync %s" msgstr "" -#: Client/core/CSettings.cpp:4508 -msgid "SCREEN UPLOAD INFORMATION" +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:585 +#, c-format +msgid "Disconnected: You were kicked by %s" msgstr "" -#: Client/core/CSettings.cpp:4523 -msgid "" -"Some scripts may play sounds, such as radio, from the internet.\n" -"\n" -"Disabling this setting may decrease network\n" -"bandwidth consumption.\n" +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:590 +#, c-format +msgid "Disconnected: You were banned by %s" msgstr "" -#: Client/core/CSettings.cpp:4526 -msgid "EXTERNAL SOUNDS" +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:601 +msgid "Disconnected: Server shutdown or restarting" msgstr "" -#: Client/core/CSettings.cpp:4555 -msgid "" -"It seems that you have the Rich Presence connection option enabled.\n" -"Do you want to allow servers to share their data?\n" -"\n" -"This includes yours unique ID identifier." +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:621 +msgid "You were kicked from the game" msgstr "" -#: Client/core/CSettings.cpp:4560 -msgid "CONSENT TO ALLOW DATA SHARING" +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:622 +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:633 +msgid "This server requires a non-modifed gta_sa.exe" msgstr "" -#: Client/core/CSettings.cpp:4584 -msgid "" -"Some files in your GTA:SA data directory are customized.\n" -"MTA will only use these modified files if this check box is ticked.\n" -"\n" -"However, CUSTOMIZED GTA:SA FILES ARE BLOCKED BY MANY SERVERS\n" -"\n" -"Are you sure you want to use them?" +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:623 +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:634 +msgid "Please replace gta_sa.exe" msgstr "" -#: Client/core/CSettings.cpp:4590 Client/core/CVersionUpdater.cpp:2081 -msgid "CUSTOMIZED GTA:SA FILES" +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:624 +msgid "This server does not allow custom D3D9.DLLs" msgstr "" -#: Client/core/CSettings.cpp:4633 -msgid "" -"Enabling DPI awareness is an experimental feature and\n" -"we only recommend it when you play MTA:SA on a scaled monitor.\n" -"You may experience graphical issues if you enable this option.\n" -"\n" -"Are you sure you want to enable this option?" +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:625 +msgid "Remove D3D9.DLL from your GTA install directory and restart MTA" msgstr "" -#: Client/core/CSettings.cpp:4639 -msgid "EXPERIMENTAL FEATURE" +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:626 +msgid "This server does not allow virtual machines" msgstr "" -#: Client/core/CSettings.cpp:4782 -msgid "Please enter a nickname" +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:627 +msgid "This server requires driver signing to be enabled" msgstr "" -#: Client/core/CSettings.cpp:4783 -msgid "" -"Please enter a nickname to be used ingame. \n" -"This will be your name when you connect to and play in a server" +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:628 +msgid "Please restart your PC" msgstr "" -#: Client/core/CSettings.cpp:4801 -msgid "Very experimental feature." +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:629 +msgid "This server has detected missing anti-cheat components" msgstr "" -#: Client/core/CSettings.cpp:4803 -msgid "Stops stalls with CJ variations (Uses 65MB more RAM)" +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:630 +msgid "Try restarting MTA" msgstr "" -#: Client/core/CSettings.cpp:4805 -msgid "Older routers may require a slower scan speed." +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:631 +msgid "This server requires a non-modifed gta3.img and gta_int.img" msgstr "" -#: Client/core/CSettings.cpp:4807 -msgid "Switch on to use only one connection when downloading." +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:632 +msgid "Please replace gta3.img or gta_int.img" msgstr "" -#: Client/core/CSettings.cpp:4809 -msgid "Tag network packets to help ISPs identify MTA traffic." +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:635 +msgid "This server does not allow Wine" msgstr "" -#: Client/core/CSettings.cpp:4811 -msgid "Spinning circle animation at the bottom of the screen" +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:636 +msgid "Ensure no other program is modifying MTA:SA" msgstr "" -#: Client/core/CSettings.cpp:4813 -msgid "Select default always. (This setting is not saved)" +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:650 +msgid "Time Remaining: " msgstr "" -#: Client/core/CSettings.cpp:4815 -msgid "Maximum is usually best" -msgstr "" +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:660 +#, c-format +msgid "%d day" +msgid_plural "%d days" +msgstr[0] "" +msgstr[1] "" -#: Client/core/CSettings.cpp:4817 Client/core/CSettings.cpp:4819 -msgid "Auto updater:" -msgstr "" +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:662 +#, c-format +msgid "%d hour" +msgid_plural "%d hours" +msgstr[0] "" +msgstr[1] "" -#: Client/core/CSettings.cpp:4817 -msgid "Select default unless you like filling out bug reports." +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:664 +#, c-format +msgid "%d minute" +msgid_plural "%d minutes" +msgstr[0] "" +msgstr[1] "" + +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:666 +#, c-format +msgid "%d second" +msgid_plural "%d seconds" +msgstr[0] "" +msgstr[1] "" + +#. Display the error +#: Client/mods/deathmatch/logic/CPacketHandler.cpp:670 +msgid "Disconnected" msgstr "" -#: Client/core/CSettings.cpp:4819 -msgid "Select default to automatically install important updates." +#: Client/core/CJoystickManager.cpp:1578 +msgid "Accelerate Axis" msgstr "" -#: Client/core/CSettings.cpp:4821 -msgid "16-bit color:" +#: Client/core/CJoystickManager.cpp:1580 +msgid "Brake Axis" msgstr "" -#: Client/core/CSettings.cpp:4821 -msgid "Enable 16 bit color modes - Requires MTA restart" +#: Client/core/CMainMenu.cpp:333 +msgid "" +"You are using a feature-branch build! This is a test build only which cannot " +"be used to connect to public servers!" msgstr "" -#: Client/core/CSettings.cpp:4823 -msgid "Mouse fix:" +#: Client/core/CMainMenu.cpp:352 +msgid "" +"MTA will not receive updates on XP/Vista after July 2019.\n" +"\n" +"Upgrade Windows to play on the latest servers." msgstr "" -#: Client/core/CSettings.cpp:4823 -msgid "Mouse movement fix - May need PC restart" +#: Client/core/CMainMenu.cpp:1193 +msgid "" +"This will disconnect you from the current server.\n" +"\n" +"Are you sure you want to disconnect?" msgstr "" -#. Create window -#: Client/core/CConsole.cpp:417 -msgid "CONSOLE" +#: Client/core/CMainMenu.cpp:1197 +msgid "DISCONNECT WARNING" msgstr "" #: Client/core/CConnectManager.cpp:79 @@ -1385,52 +1448,6 @@ msgstr "" msgid "Connecting to %s:%u ..." msgstr "" -#. Display the status box -#: Client/core/CConnectManager.cpp:148 -#: Client/mods/deathmatch/logic/CClientGame.cpp:651 -msgid "CONNECTING" -msgstr "" - -#: Client/core/CConnectManager.cpp:263 -#: Client/mods/deathmatch/logic/CClientGame.cpp:1327 -msgid "Connection timed out" -msgstr "" - -#: Client/core/CConnectManager.cpp:277 Client/core/CConnectManager.cpp:281 -#: Client/mods/deathmatch/logic/CClientGame.cpp:1375 -msgid "Disconnected: unknown protocol error" -msgstr "" - -#: Client/core/CConnectManager.cpp:285 -#: Client/mods/deathmatch/logic/CClientGame.cpp:1379 -msgid "Disconnected: disconnected remotely" -msgstr "" - -#: Client/core/CConnectManager.cpp:289 -#: Client/mods/deathmatch/logic/CClientGame.cpp:1383 -msgid "Disconnected: connection lost remotely" -msgstr "" - -#: Client/core/CConnectManager.cpp:293 -#: Client/mods/deathmatch/logic/CClientGame.cpp:1387 -msgid "Disconnected: you are banned from this server" -msgstr "" - -#: Client/core/CConnectManager.cpp:300 -#: Client/mods/deathmatch/logic/CClientGame.cpp:1395 -msgid "Disconnected: disconnected from the server" -msgstr "" - -#: Client/core/CConnectManager.cpp:304 -#: Client/mods/deathmatch/logic/CClientGame.cpp:1399 -msgid "Disconnected: connection to the server was lost" -msgstr "" - -#: Client/core/CConnectManager.cpp:311 -#: Client/mods/deathmatch/logic/CClientGame.cpp:1407 -msgid "Disconnected: connection was refused" -msgstr "" - #. Failed loading the mod #: Client/core/CConnectManager.cpp:403 #, c-format @@ -1445,17 +1462,7 @@ msgstr "" msgid "Bad server response (1)" msgstr "" -#. Unknown command -#: Client/core/CCommands.cpp:216 -msgid "Unknown command or cvar: " -msgstr "" - -#: Client/core/CCore.cpp:811 Client/loader/CInstallManager.cpp:1057 -#, c-format -msgid "MTA:SA cannot continue because drive %s does not have enough space." -msgstr "" - -#: Client/core/CCore.cpp:813 Shared/mods/deathmatch/logic/Utils.cpp:111 +#: Client/core/CCore.cpp:813 Shared/mods/deathmatch/logic/Utils.cpp:129 msgid "Fatal error" msgstr "" @@ -1567,1722 +1574,1717 @@ msgstr "" msgid "for developers: reload news" msgstr "" +#: Client/core/CCredits.cpp:34 +msgid "Programming" +msgstr "" + +#: Client/core/CCredits.cpp:63 +msgid "Contributors" +msgstr "" + +#: Client/core/CCredits.cpp:84 +msgid "Game Design / Scripting" +msgstr "" + +#: Client/core/CCredits.cpp:104 +msgid "Language Localization" +msgstr "" + +#: Client/core/CCredits.cpp:110 +msgid "Patch contributors" +msgstr "" + +#: Client/core/CCredits.cpp:234 +msgid "Special Thanks" +msgstr "" + +#: Client/core/CCredits.cpp:265 +msgid "" +"This software and project makes use of the following libraries and software:" +msgstr "" + +#: Client/core/CScreenShot.cpp:104 +#, c-format +msgid "Screenshot got %d bytes, but expected %d" +msgstr "" + +#: Client/core/CScreenShot.cpp:110 +msgid "Screenshot failed" +msgstr "" + +#: Client/core/CScreenShot.cpp:160 +#, c-format +msgid "Screenshot taken: '%s'" +msgstr "" + #. TRANSLATORS: Replace with your language native name #: Client/core/CLocalization.cpp:16 msgid "English" msgstr "" +#. Create window +#: Client/core/CConsole.cpp:417 +msgid "CONSOLE" +msgstr "" + #: Client/core/CQuestionBox.cpp:192 Shared/sdk/SharedUtil.Misc.hpp:688 msgid "Do you want to see some on-line help about this problem ?" msgstr "" -#: Client/core/CVersionUpdater.cpp:626 -msgid "Busy" +#. Create window (with frame) if it will fit inside the screen resolution +#: Client/core/CSettings.cpp:84 +msgid "SETTINGS" msgstr "" -#: Client/core/CVersionUpdater.cpp:626 -msgid "Can't check for updates right now" +#: Client/core/CSettings.cpp:116 +msgid "Multiplayer" msgstr "" -#: Client/core/CVersionUpdater.cpp:1567 Client/core/CVersionUpdater.cpp:1587 -#: Client/core/CVersionUpdater.cpp:1605 -#, c-format -msgid "MTA:SA %s required" +#: Client/core/CSettings.cpp:117 +msgid "Video" msgstr "" -#: Client/core/CVersionUpdater.cpp:1568 -#, c-format -msgid "" -"An updated version of MTA:SA %s is required to join the selected server.\n" -"\n" -"Do you want to download and install MTA:SA %s ?" +#: Client/core/CSettings.cpp:118 +msgid "Audio" msgstr "" -#: Client/core/CVersionUpdater.cpp:1588 -#, c-format -msgid "Do you want to launch MTA:SA %s and connect to this server ?" +#: Client/core/CSettings.cpp:119 +msgid "Binds" msgstr "" -#: Client/core/CVersionUpdater.cpp:1606 -msgid "" -"It is not possible to connect at this time.\n" -"\n" -"Please try later." +#: Client/core/CSettings.cpp:120 +msgid "Controls" msgstr "" -#: Client/core/CVersionUpdater.cpp:1788 -msgid "Connecting" +#: Client/core/CSettings.cpp:121 +msgid "Interface" msgstr "" -#: Client/core/CVersionUpdater.cpp:1789 Client/core/CVersionUpdater.cpp:1805 -msgid "Please wait..." +#: Client/core/CSettings.cpp:122 +msgid "Web Browser" msgstr "" -#: Client/core/CVersionUpdater.cpp:1804 -msgid "CHECKING" +#: Client/core/CSettings.cpp:123 +msgid "Advanced" msgstr "" -#: Client/core/CVersionUpdater.cpp:1821 Client/core/CVersionUpdater.cpp:1914 -msgid "UPDATE CHECK" +#: Client/core/CSettings.cpp:147 Client/core/CSettings.cpp:338 +#: Client/core/CSettings.cpp:617 Client/core/CSettings.cpp:889 +msgid "Load defaults" msgstr "" -#: Client/core/CVersionUpdater.cpp:1822 -msgid "No update needed" +#. * +#. * Controls tab +#. * +#: Client/core/CSettings.cpp:157 Client/core/CSettings.cpp:181 +msgid "Mouse sensitivity:" msgstr "" -#: Client/core/CVersionUpdater.cpp:1839 -msgid "DOWNLOADING" +#. VerticalAimSensitivity +#: Client/core/CSettings.cpp:157 Client/core/CSettings.cpp:199 +msgid "Vertical aim sensitivity:" msgstr "" -#: Client/core/CVersionUpdater.cpp:1840 -msgid "waiting..." +#. Mouse Options +#: Client/core/CSettings.cpp:160 +msgid "Mouse options" msgstr "" -#: Client/core/CVersionUpdater.cpp:1856 -msgid "MANDATORY UPDATE" +#: Client/core/CSettings.cpp:167 +msgid "Invert mouse vertically" msgstr "" -#: Client/core/CVersionUpdater.cpp:1857 -msgid "" -"To join this server, you must update MTA.\n" -"\n" -" Do you want to update now ?" +#: Client/core/CSettings.cpp:171 +msgid "Steer with mouse" +msgstr "" + +#: Client/core/CSettings.cpp:175 +msgid "Fly with mouse" +msgstr "" + +#. Joypad options +#: Client/core/CSettings.cpp:217 +msgid "Joypad options" +msgstr "" + +#: Client/core/CSettings.cpp:230 +msgid "Standard controls (Mouse + Keyboard)" +msgstr "" + +#: Client/core/CSettings.cpp:237 +msgid "Classic controls (Joypad)" +msgstr "" + +#: Client/core/CSettings.cpp:274 +msgid "Dead Zone" +msgstr "" + +#: Client/core/CSettings.cpp:279 +msgid "Saturation" +msgstr "" + +#: Client/core/CSettings.cpp:285 +msgid "Use the 'Binds' tab for joypad buttons." +msgstr "" + +#: Client/core/CSettings.cpp:324 +msgid "Left Stick" +msgstr "" + +#: Client/core/CSettings.cpp:330 +msgid "Right Stick" +msgstr "" + +#: Client/core/CSettings.cpp:345 +msgid "DESCRIPTION" +msgstr "" + +#: Client/core/CSettings.cpp:346 +msgid "KEY" +msgstr "" + +#: Client/core/CSettings.cpp:348 +msgid "ALT. KEY" +msgstr "" + +#. * +#. * Multiplayer tab +#. * +#: Client/core/CSettings.cpp:353 Client/core/CSettings.cpp:356 +msgid "Nick:" +msgstr "" + +#: Client/core/CSettings.cpp:378 +msgid "Save server passwords" +msgstr "" + +#: Client/core/CSettings.cpp:383 +msgid "Auto-refresh server browser" +msgstr "" + +#: Client/core/CSettings.cpp:388 +msgid "Allow screen upload" msgstr "" -#: Client/core/CVersionUpdater.cpp:1875 -msgid "OPTIONAL UPDATE" +#: Client/core/CSettings.cpp:393 +msgid "Allow external sounds" msgstr "" -#: Client/core/CVersionUpdater.cpp:1876 -msgid "" -"Server says an update is recommended, but not essential.\n" -"\n" -" Do you want to update now ?" +#: Client/core/CSettings.cpp:398 +msgid "Always show download window" msgstr "" -#: Client/core/CVersionUpdater.cpp:1915 -msgid "" -"Update not currently avalable.\n" -"\n" -"Please check www.mtasa.com" +#: Client/core/CSettings.cpp:403 +msgid "Allow connecting with Discord Rich Presence" msgstr "" -#: Client/core/CVersionUpdater.cpp:1936 Client/core/CVersionUpdater.cpp:2118 -msgid "ERROR SAVING" +#: Client/core/CSettings.cpp:408 +msgid "Use customized GTA:SA files" msgstr "" -#: Client/core/CVersionUpdater.cpp:1937 Client/core/CVersionUpdater.cpp:2119 -msgid "Unable to create the file." +#: Client/core/CSettings.cpp:413 +msgid "Map rendering options" msgstr "" -#: Client/core/CVersionUpdater.cpp:1945 Client/core/CVersionUpdater.cpp:1954 -#: Client/core/CVersionUpdater.cpp:2127 Client/core/CVersionUpdater.cpp:2136 -msgid "ERROR DOWNLOADING" +#: Client/core/CSettings.cpp:419 Client/core/CSettings.cpp:628 +msgid "Opacity:" msgstr "" -#: Client/core/CVersionUpdater.cpp:1946 Client/core/CVersionUpdater.cpp:2128 -msgid "The downloaded file appears to be incorrect." +#. * +#. * Audio tab +#. * +#: Client/core/CSettings.cpp:439 Client/core/CSettings.cpp:448 +msgid "Master volume:" msgstr "" -#: Client/core/CVersionUpdater.cpp:1955 Client/core/CVersionUpdater.cpp:2137 -msgid "For some reason." +#: Client/core/CSettings.cpp:439 Client/core/CSettings.cpp:467 +msgid "Radio volume:" msgstr "" -#: Client/core/CVersionUpdater.cpp:1966 Client/core/CVersionUpdater.cpp:2150 -msgid "DOWNLOAD COMPLETE" +#: Client/core/CSettings.cpp:439 Client/core/CSettings.cpp:486 +msgid "SFX volume:" msgstr "" -#: Client/core/CVersionUpdater.cpp:1990 -msgid " - Unknown problem in _DialogUpdateResult" +#: Client/core/CSettings.cpp:439 Client/core/CSettings.cpp:505 +msgid "MTA volume:" msgstr "" -#: Client/core/CVersionUpdater.cpp:2088 Client/core/CVersionUpdater.cpp:2098 -msgid "Ok" +#: Client/core/CSettings.cpp:440 Client/core/CSettings.cpp:524 +msgid "Voice volume:" msgstr "" -#: Client/core/CVersionUpdater.cpp:2096 -msgid "ERROR" +#: Client/core/CSettings.cpp:440 Client/core/CSettings.cpp:565 +msgid "Play mode:" msgstr "" -#: Client/core/CVersionUpdater.cpp:2097 -msgid "" -"Some MTA:SA data files are missing.\n" -"\n" -"\n" -"Please reinstall MTA:SA" +#: Client/core/CSettings.cpp:543 +msgid "Radio options" msgstr "" -#: Client/core/CVersionUpdater.cpp:2774 -#, c-format -msgid "%3d %% completed" +#: Client/core/CSettings.cpp:549 +msgid "Radio Equalizer" msgstr "" -#: Client/core/CVersionUpdater.cpp:2777 -#, c-format -msgid "" -"\n" -"\n" -"Waiting for response - %-3d" +#: Client/core/CSettings.cpp:554 +msgid "Radio Auto-tune" msgstr "" -#: Client/core/CCommandFuncs.cpp:24 -msgid "***[ COMMAND HELP ]***\n" +#: Client/core/CSettings.cpp:559 +msgid "Usertrack options" msgstr "" -#: Client/core/CCommandFuncs.cpp:158 -#, c-format -msgid "* The time is %d:%02d:%02d" +#: Client/core/CSettings.cpp:573 Client/core/CSettings.cpp:3087 +msgid "Radio" msgstr "" -#: Client/core/CCommandFuncs.cpp:242 -msgid "connect: Syntax is 'connect [ ]'" +#: Client/core/CSettings.cpp:574 Client/core/CSettings.cpp:3089 +msgid "Random" msgstr "" -#: Client/core/CCommandFuncs.cpp:250 Client/core/CCommandFuncs.cpp:318 -msgid "connect: Bad port number" +#: Client/core/CSettings.cpp:575 Client/core/CSettings.cpp:3091 +msgid "Sequential" msgstr "" -#: Client/core/CCommandFuncs.cpp:272 Client/core/CCommandFuncs.cpp:333 -#, c-format -msgid "connect: Connecting to %s:%u..." +#: Client/core/CSettings.cpp:578 +msgid "Automatic Media Scan" msgstr "" -#: Client/core/CCommandFuncs.cpp:276 Client/core/CCommandFuncs.cpp:337 -#, c-format -msgid "connect: could not connect to %s:%u!" +#: Client/core/CSettings.cpp:585 +msgid "Mute options" msgstr "" -#: Client/core/CCommandFuncs.cpp:281 -msgid "connect: Failed to unload current mod" +#: Client/core/CSettings.cpp:591 +msgid "Mute All sounds when minimized" msgstr "" -#: Client/core/CCommandFuncs.cpp:371 -msgid "Bound all controls from GTA" +#: Client/core/CSettings.cpp:596 +msgid "Mute Radio sounds when minimized" msgstr "" -#: Client/core/CCommandFuncs.cpp:385 -msgid "Saved configuration file" +#: Client/core/CSettings.cpp:601 +msgid "Mute SFX sounds when minimized" msgstr "" -#. Print it -#: Client/core/CCommandFuncs.cpp:451 -#, c-format -msgid "* Your serial is: %s" +#: Client/core/CSettings.cpp:606 +msgid "Mute MTA sounds when minimized" msgstr "" -#: Client/core/CMainMenu.cpp:333 -msgid "" -"You are using a feature-branch build! This is a test build only which cannot " -"be used to connect to public servers!" +#: Client/core/CSettings.cpp:611 +msgid "Mute Voice sounds when minimized" msgstr "" -#: Client/core/CMainMenu.cpp:352 -msgid "" -"MTA will not receive updates on XP/Vista after July 2019.\n" -"\n" -"Upgrade Windows to play on the latest servers." +#. * +#. * Video tab +#. * +#: Client/core/CSettings.cpp:627 Client/core/CSettings.cpp:636 +msgid "Resolution:" msgstr "" -#: Client/core/CMainMenu.cpp:1193 -msgid "" -"This will disconnect you from the current server.\n" -"\n" -"Are you sure you want to disconnect?" +#: Client/core/CSettings.cpp:627 Client/core/CSettings.cpp:683 +msgid "FOV:" msgstr "" -#: Client/core/CMainMenu.cpp:1197 -msgid "DISCONNECT WARNING" +#: Client/core/CSettings.cpp:627 Client/core/CSettings.cpp:699 +msgid "Draw Distance:" msgstr "" -#: Client/core/ServerBrowser/CServerList.cpp:25 -msgid "Idle" +#: Client/core/CSettings.cpp:627 Client/core/CSettings.cpp:717 +msgid "Brightness:" msgstr "" -#: Client/core/ServerBrowser/CServerList.cpp:150 -msgid "player" -msgid_plural "players" -msgstr[0] "" -msgstr[1] "" +#: Client/core/CSettings.cpp:627 Client/core/CSettings.cpp:735 +msgid "FX Quality:" +msgstr "" -#: Client/core/ServerBrowser/CServerList.cpp:151 -msgid "on" +#: Client/core/CSettings.cpp:628 Client/core/CSettings.cpp:749 +msgid "Anisotropic filtering:" msgstr "" -#: Client/core/ServerBrowser/CServerList.cpp:154 -msgid "server" -msgid_plural "servers" -msgstr[0] "" -msgstr[1] "" +#: Client/core/CSettings.cpp:628 Client/core/CSettings.cpp:776 +msgid "Anti-aliasing:" +msgstr "" -#. We are polling for the master server list (first pass) -#: Client/core/ServerBrowser/CServerList.cpp:238 -#, c-format -msgid "Requesting master server list (%lu ms elapsed)" +#: Client/core/CSettings.cpp:628 Client/core/CSettings.cpp:790 +msgid "Aspect Ratio:" msgstr "" -#. Abort -#: Client/core/ServerBrowser/CServerList.cpp:254 -msgid "Master server list could not be parsed." +#: Client/core/CSettings.cpp:648 +msgid "Windowed" msgstr "" -#. Abort -#: Client/core/ServerBrowser/CServerList.cpp:264 -msgid "Master server list could not be retrieved." +#: Client/core/CSettings.cpp:654 +msgid "DPI aware" msgstr "" -#: Client/core/ServerBrowser/CServerList.cpp:274 -msgid "(Backup server list)" +#: Client/core/CSettings.cpp:669 Client/core/CSettings.cpp:1613 +msgid "Standard" msgstr "" -#: Client/core/ServerBrowser/CServerList.cpp:326 -msgid "Cannot bind LAN-broadcast socket" +#: Client/core/CSettings.cpp:671 Client/core/CSettings.cpp:1617 +msgid "Borderless keep res" msgstr "" -#: Client/core/ServerBrowser/CServerList.cpp:345 -msgid "Attempting to discover LAN servers" +#: Client/core/CSettings.cpp:675 +msgid "Mip Mapping" msgstr "" -#. Create queue window -#: Client/core/ServerBrowser/CServerInfo.cpp:32 -#: Client/core/ServerBrowser/CServerInfo.cpp:302 -msgid "SERVER IS FULL" +#: Client/core/CSettings.cpp:743 Client/core/CSettings.cpp:1517 +msgid "Low" msgstr "" -#. Determine our label draw position for L10n -#. Start position -#. Server Name -#: Client/core/ServerBrowser/CServerInfo.cpp:44 -#: Client/core/ServerBrowser/CServerInfo.cpp:53 -msgid "Name:" +#: Client/core/CSettings.cpp:744 Client/core/CSettings.cpp:1519 +msgid "Medium" msgstr "" -#. Server IP -#: Client/core/ServerBrowser/CServerInfo.cpp:44 -#: Client/core/ServerBrowser/CServerInfo.cpp:64 -msgid "Server Address:" +#: Client/core/CSettings.cpp:745 Client/core/CSettings.cpp:1086 +#: Client/core/CSettings.cpp:1521 Client/core/CSettings.cpp:3145 +msgid "High" msgstr "" -#. Gamemode -#: Client/core/ServerBrowser/CServerInfo.cpp:44 -#: Client/core/ServerBrowser/CServerInfo.cpp:75 -msgid "Gamemode:" +#: Client/core/CSettings.cpp:746 Client/core/CSettings.cpp:1523 +msgid "Very high" msgstr "" -#. Map -#: Client/core/ServerBrowser/CServerInfo.cpp:44 -#: Client/core/ServerBrowser/CServerInfo.cpp:86 -msgid "Map:" +#: Client/core/CSettings.cpp:761 Client/core/CSettings.cpp:784 +#: Client/core/CSettings.cpp:1017 Client/core/CSettings.cpp:1071 +#: Client/core/CSettings.cpp:1201 Client/core/CSettings.cpp:1527 +#: Client/core/CSettings.cpp:3152 Client/core/CSettings.cpp:3184 +#: Client/core/CSettings.cpp:3206 Client/core/CSettings.cpp:4234 +msgid "Off" msgstr "" -#. Players -#: Client/core/ServerBrowser/CServerInfo.cpp:45 -#: Client/core/ServerBrowser/CServerInfo.cpp:97 -msgid "Players:" +#: Client/core/CSettings.cpp:785 Client/core/CSettings.cpp:1529 +msgid "1x" msgstr "" -#. Passworded -#: Client/core/ServerBrowser/CServerInfo.cpp:45 -#: Client/core/ServerBrowser/CServerInfo.cpp:108 -msgid "Passworded:" +#: Client/core/CSettings.cpp:786 Client/core/CSettings.cpp:1531 +msgid "2x" +msgstr "" + +#: Client/core/CSettings.cpp:787 Client/core/CSettings.cpp:1533 +msgid "3x" msgstr "" -#. Latency -#: Client/core/ServerBrowser/CServerInfo.cpp:45 -#: Client/core/ServerBrowser/CServerInfo.cpp:119 -msgid "Latency:" +#: Client/core/CSettings.cpp:800 Client/core/CSettings.cpp:1019 +#: Client/core/CSettings.cpp:1539 Client/core/CSettings.cpp:3154 +msgid "Auto" msgstr "" -#. Column for player names -#. Player List Columns -#: Client/core/ServerBrowser/CServerInfo.cpp:138 -#: Client/core/ServerBrowser/CServerBrowser.cpp:478 -msgid "Player list" +#: Client/core/CSettings.cpp:801 Client/core/CSettings.cpp:1541 +msgid "4:3" msgstr "" -#. Close button -#: Client/core/ServerBrowser/CServerInfo.cpp:144 -msgid "Close" +#: Client/core/CSettings.cpp:802 Client/core/CSettings.cpp:1543 +msgid "16:10" msgstr "" -#. Join Game button -#: Client/core/ServerBrowser/CServerInfo.cpp:152 -msgid "Join Game" +#: Client/core/CSettings.cpp:803 Client/core/CSettings.cpp:1545 +msgid "16:9" msgstr "" -#. Please enter password label -#: Client/core/ServerBrowser/CServerInfo.cpp:166 -msgid "Please enter the password to the server:" +#: Client/core/CSettings.cpp:806 +msgid "HUD Match Aspect Ratio" msgstr "" -#: Client/core/ServerBrowser/CServerInfo.cpp:177 -msgid "Join the server as soon as a player slot is available." +#: Client/core/CSettings.cpp:812 +msgid "Volumetric Shadows" msgstr "" -#: Client/core/ServerBrowser/CServerInfo.cpp:310 -msgid "PLEASE ENTER SERVER PASSWORD" +#: Client/core/CSettings.cpp:816 +msgid "Grass effect" msgstr "" -#: Client/core/ServerBrowser/CServerInfo.cpp:319 -#: Client/core/ServerBrowser/CServerBrowser.cpp:1380 -#: Client/loader/MainFunctions.cpp:603 Client/loader/MainFunctions.cpp:610 -#: Client/loader/MainFunctions.cpp:1219 -msgid "Information" +#: Client/core/CSettings.cpp:820 +msgid "Heat haze" msgstr "" -#. The server has timed out -#: Client/core/ServerBrowser/CServerInfo.cpp:402 -msgid "Timed Out" +#: Client/core/CSettings.cpp:824 +msgid "Tyre Smoke etc" msgstr "" -#. Set every GUI elements text to blank -#: Client/core/ServerBrowser/CServerInfo.cpp:431 -msgid "Querying..." +#: Client/core/CSettings.cpp:828 +msgid "Dynamic ped shadows" msgstr "" -#. Create the window -#: Client/core/ServerBrowser/CServerBrowser.cpp:85 -msgid "SERVER BROWSER" +#: Client/core/CSettings.cpp:832 +msgid "Motion blur" msgstr "" -#. Create the tabs -#: Client/core/ServerBrowser/CServerBrowser.cpp:133 -#: Client/mods/deathmatch/logic/CLocalServer.cpp:90 -msgid "Internet" +#: Client/core/CSettings.cpp:837 +msgid "Full Screen Minimize" msgstr "" -#: Client/core/ServerBrowser/CServerBrowser.cpp:134 -msgid "Local" +#: Client/core/CSettings.cpp:849 +msgid "Enable Device Selection Dialog" msgstr "" -#: Client/core/ServerBrowser/CServerBrowser.cpp:135 -msgid "Favourites" +#: Client/core/CSettings.cpp:861 +msgid "Show unsafe resolutions" msgstr "" -#: Client/core/ServerBrowser/CServerBrowser.cpp:136 -msgid "Recent" +#: Client/core/CSettings.cpp:873 +msgid "Render vehicles always in high detail" msgstr "" -#: Client/core/ServerBrowser/CServerBrowser.cpp:191 -msgid "" -"FOR QUICK CONNECT:\n" -"\n" -"Type the address and port into the address bar.\n" -"Or select a server from the history list and press 'Connect'" +#: Client/core/CSettings.cpp:877 +msgid "Render peds always in high detail" msgstr "" -#: Client/core/ServerBrowser/CServerBrowser.cpp:203 -msgid "HELP" +#: Client/core/CSettings.cpp:881 +msgid "Corona rain reflections" msgstr "" -#: Client/core/ServerBrowser/CServerBrowser.cpp:212 -#: Client/core/ServerBrowser/CServerBrowser.cpp:252 -msgid "Refresh" +#: Client/core/CSettings.cpp:910 +msgid "Enable remote websites" msgstr "" -#: Client/core/ServerBrowser/CServerBrowser.cpp:212 -#: Client/core/ServerBrowser/CServerBrowser.cpp:253 -msgid "Add Favorite" +#: Client/core/CSettings.cpp:915 +msgid "Enable Javascript on remote websites" msgstr "" -#: Client/core/ServerBrowser/CServerBrowser.cpp:212 -#: Client/core/ServerBrowser/CServerBrowser.cpp:254 -#: Client/core/ServerBrowser/CServerBrowser.cpp:301 -#: Client/core/ServerBrowser/CServerBrowser.cpp:372 -msgid "Connect" +#: Client/core/CSettings.cpp:920 +msgid "Custom blacklist" msgstr "" -#: Client/core/ServerBrowser/CServerBrowser.cpp:212 -#: Client/core/ServerBrowser/CServerBrowser.cpp:255 -msgid "Server information" +#: Client/core/CSettings.cpp:931 Client/core/CSettings.cpp:966 +msgid "Enter a domain e.g. google.com" msgstr "" -#: Client/core/ServerBrowser/CServerBrowser.cpp:213 -#: Client/core/ServerBrowser/CServerBrowser.cpp:256 -msgid "Search servers" +#: Client/core/CSettings.cpp:939 +msgid "Block" msgstr "" -#: Client/core/ServerBrowser/CServerBrowser.cpp:213 -#: Client/core/ServerBrowser/CServerBrowser.cpp:257 -msgid "Search players" +#: Client/core/CSettings.cpp:947 Client/core/CSettings.cpp:982 +msgid "Domain" msgstr "" -#: Client/core/ServerBrowser/CServerBrowser.cpp:213 -#: Client/core/ServerBrowser/CServerBrowser.cpp:258 -msgid "Start search" +#: Client/core/CSettings.cpp:949 Client/core/CSettings.cpp:984 +msgid "Remove domain" msgstr "" -#: Client/core/ServerBrowser/CServerBrowser.cpp:299 -#: Client/core/ServerBrowser/CServerBrowser.cpp:1697 -msgid "Search players..." +#. Reset vecTemp +#: Client/core/CSettings.cpp:955 +msgid "Custom whitelist" msgstr "" -#: Client/core/ServerBrowser/CServerBrowser.cpp:422 -#: Client/core/ServerBrowser/CServerBrowser.cpp:1695 -msgid "Search servers..." +#. Misc section label +#: Client/core/CSettings.cpp:997 +msgid "Misc" msgstr "" -#: Client/core/ServerBrowser/CServerBrowser.cpp:453 -msgid "Name" +#. Fast clothes loading +#: Client/core/CSettings.cpp:1003 Client/core/CSettings.cpp:1010 +#: Client/core/CSettings.cpp:4803 +msgid "Fast CJ clothes loading:" msgstr "" -#: Client/core/ServerBrowser/CServerBrowser.cpp:454 -msgid "Players" +#. Browser scan speed +#: Client/core/CSettings.cpp:1003 Client/core/CSettings.cpp:1024 +#: Client/core/CSettings.cpp:4805 +msgid "Browser speed:" msgstr "" -#: Client/core/ServerBrowser/CServerBrowser.cpp:455 -msgid "Ping" +#. Single download +#: Client/core/CSettings.cpp:1003 Client/core/CSettings.cpp:1038 +#: Client/core/CSettings.cpp:4807 +msgid "Single connection:" msgstr "" -#: Client/core/ServerBrowser/CServerBrowser.cpp:456 -msgid "Gamemode" +#. Packet tag +#: Client/core/CSettings.cpp:1003 Client/core/CSettings.cpp:1051 +#: Client/core/CSettings.cpp:4809 +msgid "Packet tag:" msgstr "" -#. Include label -#: Client/core/ServerBrowser/CServerBrowser.cpp:486 -msgid "Include:" +#. Progress animation +#: Client/core/CSettings.cpp:1004 Client/core/CSettings.cpp:1064 +#: Client/core/CSettings.cpp:4811 +msgid "Progress animation:" msgstr "" -#: Client/core/ServerBrowser/CServerBrowser.cpp:492 -msgid "Empty" +#. Process priority +#: Client/core/CSettings.cpp:1004 Client/core/CSettings.cpp:1077 +#: Client/core/CSettings.cpp:4801 +msgid "Process priority:" msgstr "" -#: Client/core/ServerBrowser/CServerBrowser.cpp:498 -msgid "Full" +#. Debug setting +#: Client/core/CSettings.cpp:1004 Client/core/CSettings.cpp:1091 +#: Client/core/CSettings.cpp:4813 +msgid "Debug setting:" msgstr "" -#: Client/core/ServerBrowser/CServerBrowser.cpp:504 -msgid "Locked" +#. Streaming memory +#: Client/core/CSettings.cpp:1005 Client/core/CSettings.cpp:1114 +#: Client/core/CSettings.cpp:4815 +msgid "Streaming memory:" msgstr "" -#: Client/core/ServerBrowser/CServerBrowser.cpp:516 -msgid "Offline" +#. Update build type +#: Client/core/CSettings.cpp:1005 Client/core/CSettings.cpp:1215 +msgid "Update build type:" msgstr "" -#: Client/core/ServerBrowser/CServerBrowser.cpp:529 -msgid "Other Versions" +#. UpdateAutoInstall +#: Client/core/CSettings.cpp:1005 Client/core/CSettings.cpp:1194 +msgid "Install important updates:" msgstr "" -#: Client/core/ServerBrowser/CServerBrowser.cpp:550 -msgid "Back" +#: Client/core/CSettings.cpp:1018 Client/core/CSettings.cpp:1046 +#: Client/core/CSettings.cpp:1059 Client/core/CSettings.cpp:3156 +#: Client/core/CSettings.cpp:3172 Client/core/CSettings.cpp:3179 +msgid "On" msgstr "" -#: Client/core/ServerBrowser/CServerBrowser.cpp:556 -#: Client/loader/Dialogs.cpp:135 -msgid "Help" +#: Client/core/CSettings.cpp:1031 Client/core/CSettings.cpp:3161 +msgid "Very slow" msgstr "" -#: Client/core/ServerBrowser/CServerBrowser.cpp:741 -msgid "Loading..." +#: Client/core/CSettings.cpp:1032 Client/core/CSettings.cpp:1045 +#: Client/core/CSettings.cpp:1058 Client/core/CSettings.cpp:1072 +#: Client/core/CSettings.cpp:1098 Client/core/CSettings.cpp:1110 +#: Client/core/CSettings.cpp:1202 Client/core/CSettings.cpp:1222 +#: Client/core/CSettings.cpp:3163 Client/core/CSettings.cpp:3170 +#: Client/core/CSettings.cpp:3177 Client/core/CSettings.cpp:3186 +#: Client/core/CSettings.cpp:3199 +msgid "Default" msgstr "" -#: Client/core/ServerBrowser/CServerBrowser.cpp:1240 -#: Client/core/ServerBrowser/CServerBrowser.cpp:2182 -msgid " ..loading.." +#: Client/core/CSettings.cpp:1033 Client/core/CSettings.cpp:3165 +msgid "Fast" msgstr "" -#: Client/core/ServerBrowser/CServerBrowser.cpp:1278 -#: Client/core/ServerBrowser/CServerBrowser.cpp:1406 -msgid "No address specified!" +#: Client/core/CSettings.cpp:1084 Client/core/CSettings.cpp:3141 +msgid "Normal" msgstr "" -#: Client/core/ServerBrowser/CServerBrowser.cpp:1291 -msgid "Unknown protocol" +#: Client/core/CSettings.cpp:1085 Client/core/CSettings.cpp:3143 +msgid "Above normal" msgstr "" -#: Client/core/ServerBrowser/CServerBrowser.cpp:1291 -msgid "Please use the mtasa:// protocol!" +#: Client/core/CSettings.cpp:1121 +msgid "Min" msgstr "" -#: Client/core/ServerBrowser/CServerBrowser.cpp:1300 -#: Client/core/ServerBrowser/CServerBrowser.cpp:1357 -#: Client/mods/deathmatch/logic/CClientGame.cpp:635 -#: Client/mods/deathmatch/logic/CClientGame.cpp:733 -msgid "Invalid nickname! Please go to Settings and set a new one!" +#: Client/core/CSettings.cpp:1134 +msgid "Max" msgstr "" -#: Client/core/ServerBrowser/CServerBrowser.cpp:1380 -msgid "You have to select a server to connect to." +#. Windows 8 compatibility +#: Client/core/CSettings.cpp:1141 +msgid "Windows 8 compatibility:" msgstr "" -#: Client/core/DXHook/CDirect3DHook9.cpp:124 -msgid "" -"Could not initialize Direct3D9.\n" -"\n" -"Please ensure the DirectX End-User Runtime and\n" -"latest Windows Service Packs are installed correctly." +#: Client/core/CSettings.cpp:1145 +msgid "16-bit color" msgstr "" -#: Client/mods/deathmatch/CClient.cpp:36 -msgid "This version has expired." +#: Client/core/CSettings.cpp:1150 +msgid "Mouse fix" msgstr "" -#: Client/mods/deathmatch/CClient.cpp:56 -msgid "disconnect from the game" +#. Cache path info +#: Client/core/CSettings.cpp:1168 +msgid "Client resource files:" msgstr "" -#: Client/mods/deathmatch/CClient.cpp:57 -msgid "shows the nametags" +#: Client/core/CSettings.cpp:1172 +msgid "Show in Explorer" msgstr "" -#: Client/mods/deathmatch/CClient.cpp:58 -msgid "shows the chatbox" +#. Auto updater section label +#: Client/core/CSettings.cpp:1187 Client/core/CSettings.cpp:1190 +msgid "Auto updater" msgstr "" -#: Client/mods/deathmatch/CClient.cpp:59 -msgid "shows the network statistics" +#. Check for updates +#: Client/core/CSettings.cpp:1228 +msgid "Check for update now" msgstr "" -#. Key commands (registered as 'mod commands', can be disabled) -#: Client/mods/deathmatch/CClient.cpp:62 -msgid "open the chat input" +#: Client/core/CSettings.cpp:1382 +msgid "Some settings will be changed when you next start MTA" msgstr "" -#: Client/mods/deathmatch/CClient.cpp:63 -msgid "transmits voice to other players" +#: Client/core/CSettings.cpp:1383 +msgid "" +"\n" +"\n" +"Do you want to restart now?" msgstr "" -#: Client/mods/deathmatch/CClient.cpp:64 -msgid "enters a car as passenger" +#: Client/core/CSettings.cpp:1386 +msgid "RESTART REQUIRED" msgstr "" -#: Client/mods/deathmatch/CClient.cpp:65 -msgid "next radio channel" +#: Client/core/CSettings.cpp:1406 +msgid "Some settings will be changed when you disconnect the current server" msgstr "" -#: Client/mods/deathmatch/CClient.cpp:66 -msgid "previous radio channel" +#: Client/core/CSettings.cpp:1407 +msgid "" +"\n" +"\n" +"Do you want to disconnect now?" msgstr "" -#: Client/mods/deathmatch/CClient.cpp:67 -msgid "enables the radar view" +#: Client/core/CSettings.cpp:1410 +msgid "DISCONNECT REQUIRED" msgstr "" -#: Client/mods/deathmatch/CClient.cpp:68 -msgid "zooms the radar in" +#. Update the joystick name +#: Client/core/CSettings.cpp:1737 +msgid "Joypad not detected - Check connections and restart game" msgstr "" -#: Client/mods/deathmatch/CClient.cpp:69 -msgid "zooms the radar out" +#: Client/core/CSettings.cpp:1932 +msgid "Binding axis" msgstr "" -#: Client/mods/deathmatch/CClient.cpp:70 -msgid "moves the radar north" +#: Client/core/CSettings.cpp:1932 +msgid "Move an axis to bind, or escape to clear" msgstr "" -#: Client/mods/deathmatch/CClient.cpp:71 -msgid "moves the radar south" +#: Client/core/CSettings.cpp:2009 +msgid "Language:" msgstr "" -#: Client/mods/deathmatch/CClient.cpp:72 -msgid "moves the radar east" +#: Client/core/CSettings.cpp:2009 +msgid "Skin:" msgstr "" -#: Client/mods/deathmatch/CClient.cpp:73 -msgid "moves the radar west" +#: Client/core/CSettings.cpp:2009 +msgid "Presets:" msgstr "" -#: Client/mods/deathmatch/CClient.cpp:74 -msgid "attaches the radar" +#: Client/core/CSettings.cpp:2058 +msgid "Chat" msgstr "" -#: Client/mods/deathmatch/CClient.cpp:75 -msgid "reduces radar opacity" +#: Client/core/CSettings.cpp:2075 +msgid "Load" msgstr "" -#: Client/mods/deathmatch/CClient.cpp:76 -msgid "increases radar opacity" +#: Client/core/CSettings.cpp:2087 +msgid "Colors" msgstr "" -#: Client/mods/deathmatch/CClient.cpp:77 -msgid "toggles radar help text" +#: Client/core/CSettings.cpp:2088 +msgid "Layout" msgstr "" -#: Client/mods/deathmatch/CClient.cpp:78 -msgid "sends a message to the targetted player" +#: Client/core/CSettings.cpp:2089 Client/core/CSettings.cpp:2335 +msgid "Options" msgstr "" -#: Client/mods/deathmatch/CClient.cpp:79 -msgid "changes to the next weapon whilst in a vehicle" +#: Client/core/CSettings.cpp:2095 +msgid "Chat Background" msgstr "" -#: Client/mods/deathmatch/CClient.cpp:80 -msgid "changes to the previous weapon whilst in a vehicle" +#: Client/core/CSettings.cpp:2095 +msgid "Chat Text" msgstr "" -#: Client/mods/deathmatch/CClient.cpp:81 -msgid "outputs info about the current server" +#: Client/core/CSettings.cpp:2095 +msgid "Input Background" msgstr "" -#. ACHTUNG" Should this be handled by the atomic cvar setter? -#: Client/mods/deathmatch/CClient.cpp:84 -msgid "defines the scale multiplier of all text-displays" +#: Client/core/CSettings.cpp:2095 +msgid "Input Text" msgstr "" -#. Development mode -#: Client/mods/deathmatch/CClient.cpp:91 -msgid "(Development mode) shows the colshapes" +#: Client/core/CSettings.cpp:2118 +msgid "Lines:" msgstr "" -#: Client/mods/deathmatch/CClient.cpp:92 -msgid "(Development mode) prints world sound ids into the debug window" +#: Client/core/CSettings.cpp:2118 +msgid "Scale:" msgstr "" -#. Throw the error and disconnect -#: Client/mods/deathmatch/logic/CResourceFileDownloadManager.cpp:141 -#, c-format -msgid "Download error: %s" +#: Client/core/CSettings.cpp:2118 +msgid "Width:" msgstr "" -#: Client/mods/deathmatch/logic/CTransferBox.cpp:25 -msgid "Map download progress:" +#: Client/core/CSettings.cpp:2121 +msgid "Size" msgstr "" -#: Client/mods/deathmatch/logic/CTransferBox.cpp:28 -msgid "Download Progress:" +#: Client/core/CSettings.cpp:2170 +msgid "after" msgstr "" -#. Find our largest piece of text, so we can size accordingly -#: Client/mods/deathmatch/logic/CTransferBox.cpp:42 -#: Client/mods/deathmatch/logic/CTransferBox.cpp:105 -#, c-format -msgid "%s of %s" +#: Client/core/CSettings.cpp:2170 +msgid "for" msgstr "" -#: Client/mods/deathmatch/logic/CTransferBox.cpp:44 -#: Client/mods/deathmatch/logic/CTransferBox.cpp:65 -msgid "Disconnect to cancel download" +#: Client/core/CSettings.cpp:2170 +msgid "sec" msgstr "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:506 -msgid "Disconnected: Invalid nickname" +#: Client/core/CSettings.cpp:2173 +msgid "Fading" msgstr "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:510 -msgid "Disconnect from server" +#: Client/core/CSettings.cpp:2179 +msgid "Fade out old lines" msgstr "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:514 -#, c-format -msgid "" -"Disconnected: Serial is banned.\n" -"Reason: %s" +#: Client/core/CSettings.cpp:2219 +msgid "Horizontal:" msgstr "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:520 -#, c-format -msgid "" -"Disconnected: You are banned.\n" -"Reason: %s" +#: Client/core/CSettings.cpp:2219 +msgid "Vertical:" msgstr "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:526 -#, c-format -msgid "" -"Disconnected: Account is banned.\n" -"Reason: %s" +#: Client/core/CSettings.cpp:2219 +msgid "Text-Align:" msgstr "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:531 -msgid "Disconnected: Version mismatch" +#: Client/core/CSettings.cpp:2219 +msgid "X-Offset:" msgstr "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:535 -msgid "Disconnected: Join flood. Please wait a minute, then reconnect." +#: Client/core/CSettings.cpp:2220 +msgid "Y-Offset:" msgstr "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:539 -#, c-format -msgid "" -"Disconnected: Server from different branch.\n" -"Information: %s" +#: Client/core/CSettings.cpp:2226 +msgid "Position" msgstr "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:544 -#, c-format -msgid "" -"Disconnected: Bad version.\n" -"Information: %s" +#: Client/core/CSettings.cpp:2240 Client/core/CSettings.cpp:2268 +#: Client/core/CKeyBinds.cpp:191 +msgid "Left" msgstr "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:549 -#, c-format -msgid "" -"Disconnected: Server is running a newer build.\n" -"Information: %s" +#: Client/core/CSettings.cpp:2241 Client/core/CSettings.cpp:2255 +msgid "Center" msgstr "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:554 -#, c-format -msgid "" -"Disconnected: Server is running an older build.\n" -"Information: %s" +#: Client/core/CSettings.cpp:2242 Client/core/CSettings.cpp:2269 +#: Client/core/CKeyBinds.cpp:192 +msgid "Right" msgstr "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:559 -msgid "Disconnected: Nick already in use" +#: Client/core/CSettings.cpp:2254 +msgid "Top" msgstr "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:563 -msgid "Disconnected: Player element could not be created." +#: Client/core/CSettings.cpp:2256 +msgid "Bottom" msgstr "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:567 -#, c-format -msgid "Disconnected: Server refused the connection: %s" +#: Client/core/CSettings.cpp:2304 +msgid "Font" msgstr "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:572 -msgid "Disconnected: Serial verification failed" +#: Client/core/CSettings.cpp:2341 +msgid "Hide background when not typing" msgstr "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:576 -#, c-format -msgid "Disconnected: Connection desync %s" +#: Client/core/CSettings.cpp:2346 +msgid "Nickname completion using the \"Tab\" key" msgstr "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:585 -#, c-format -msgid "Disconnected: You were kicked by %s" +#: Client/core/CSettings.cpp:2351 +msgid "Allow server to flash the window" msgstr "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:590 -#, c-format -msgid "Disconnected: You were banned by %s" +#: Client/core/CSettings.cpp:2356 +msgid "Allow tray balloon notifications" msgstr "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:601 -msgid "Disconnected: Server shutdown or restarting" +#: Client/core/CSettings.cpp:2361 +msgid "Chat text black/white outline" +msgstr "" + +#. Create a messagebox to notify the user +#. SString strText = SString::Printf ( "Press a key to bind to '%s'", pItemBind->GetText ().c_str () ); +#. Create a messagebox to notify the user +#. sSString strText = SString::Printf ( "Press a key to bind to '%s'", pItemBind->GetText ().c_str () ); +#: Client/core/CSettings.cpp:2610 Client/core/CSettings.cpp:2617 +msgid "Press a key to bind, or escape to clear" msgstr "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:621 -msgid "You were kicked from the game" +#: Client/core/CSettings.cpp:2611 +msgid "Binding a primary key" msgstr "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:622 -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:633 -msgid "This server requires a non-modifed gta_sa.exe" +#: Client/core/CSettings.cpp:2618 +msgid "Binding a secondary key" msgstr "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:623 -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:634 -msgid "Please replace gta_sa.exe" +#: Client/core/CSettings.cpp:2694 +msgid "GTA GAME CONTROLS" msgstr "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:624 -msgid "This server does not allow custom D3D9.DLLs" +#: Client/core/CSettings.cpp:2696 +msgid "MULTIPLAYER CONTROLS" msgstr "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:625 -msgid "Remove D3D9.DLL from your GTA install directory and restart MTA" +#: Client/core/CSettings.cpp:2941 Client/core/CSettings.cpp:4764 +msgid "Your nickname contains invalid characters!" msgstr "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:626 -msgid "This server does not allow virtual machines" +#: Client/core/CSettings.cpp:3778 +msgid "Red:" msgstr "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:627 -msgid "This server requires driver signing to be enabled" +#: Client/core/CSettings.cpp:3778 +msgid "Green:" msgstr "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:628 -msgid "Please restart your PC" +#: Client/core/CSettings.cpp:3778 +msgid "Blue:" msgstr "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:629 -msgid "This server has detected missing anti-cheat components" +#: Client/core/CSettings.cpp:3778 +msgid "Transparency:" msgstr "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:630 -msgid "Try restarting MTA" +#: Client/core/CSettings.cpp:3781 +msgid "Color" msgstr "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:631 -msgid "This server requires a non-modifed gta3.img and gta_int.img" +#: Client/core/CSettings.cpp:3858 +msgid "Preview" msgstr "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:632 -msgid "Please replace gta3.img or gta_int.img" +#: Client/core/CSettings.cpp:4166 +msgid "Please disconnect before changing language" msgstr "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:635 -msgid "This server does not allow Wine" +#: Client/core/CSettings.cpp:4194 +msgid "Please disconnect before changing skin" msgstr "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:636 -msgid "Ensure no other program is modifying MTA:SA" +#: Client/core/CSettings.cpp:4482 +msgid "" +"Volmetric shadows can cause some systems to slow down.\n" +"\n" +"Are you sure you want to enable them?" msgstr "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:650 -msgid "Time Remaining: " +#: Client/core/CSettings.cpp:4486 +msgid "PERFORMANCE WARNING" msgstr "" -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:660 -#, c-format -msgid "%d day" -msgid_plural "%d days" -msgstr[0] "" -msgstr[1] "" - -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:662 -#, c-format -msgid "%d hour" -msgid_plural "%d hours" -msgstr[0] "" -msgstr[1] "" - -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:664 -#, c-format -msgid "%d minute" -msgid_plural "%d minutes" -msgstr[0] "" -msgstr[1] "" - -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:666 -#, c-format -msgid "%d second" -msgid_plural "%d seconds" -msgstr[0] "" -msgstr[1] "" - -#. Display the error -#: Client/mods/deathmatch/logic/CPacketHandler.cpp:670 -msgid "Disconnected" +#: Client/core/CSettings.cpp:4506 +msgid "" +"Screen upload is required by some servers for anti-cheat purposes.\n" +"\n" +"(The chat box and GUI is excluded from the upload)\n" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:369 -msgid "Flying a UFO around" +#: Client/core/CSettings.cpp:4508 +msgid "SCREEN UPLOAD INFORMATION" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:369 -msgid "Cruising around" +#: Client/core/CSettings.cpp:4523 +msgid "" +"Some scripts may play sounds, such as radio, from the internet.\n" +"\n" +"Disabling this setting may decrease network\n" +"bandwidth consumption.\n" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:369 -msgid "Riding the waves of" +#: Client/core/CSettings.cpp:4526 +msgid "EXTERNAL SOUNDS" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:370 -msgid "Riding the train in" +#: Client/core/CSettings.cpp:4555 +msgid "" +"It seems that you have the Rich Presence connection option enabled.\n" +"Do you want to allow servers to share their data?\n" +"\n" +"This includes yours unique ID identifier." msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:370 -msgid "Flying around" +#: Client/core/CSettings.cpp:4560 +msgid "CONSENT TO ALLOW DATA SHARING" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:371 -msgid "Riding around" +#: Client/core/CSettings.cpp:4584 +msgid "" +"Some files in your GTA:SA data directory are customized.\n" +"MTA will only use these modified files if this check box is ticked.\n" +"\n" +"However, CUSTOMIZED GTA:SA FILES ARE BLOCKED BY MANY SERVERS\n" +"\n" +"Are you sure you want to use them?" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:371 -msgid "Monster truckin' around" +#: Client/core/CSettings.cpp:4590 Client/core/CVersionUpdater.cpp:2081 +msgid "CUSTOMIZED GTA:SA FILES" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:371 -msgid "Quaddin' around" +#: Client/core/CSettings.cpp:4633 +msgid "" +"Enabling DPI awareness is an experimental feature and\n" +"we only recommend it when you play MTA:SA on a scaled monitor.\n" +"You may experience graphical issues if you enable this option.\n" +"\n" +"Are you sure you want to enable this option?" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:372 -msgid "Bunny hopping around" +#: Client/core/CSettings.cpp:4639 +msgid "EXPERIMENTAL FEATURE" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:372 -msgid "Doing weird stuff in" +#: Client/core/CSettings.cpp:4782 +msgid "Please enter a nickname" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:376 -msgid "Climbing around in" +#: Client/core/CSettings.cpp:4783 +msgid "" +"Please enter a nickname to be used ingame. \n" +"This will be your name when you connect to and play in a server" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:377 -#: Client/mods/deathmatch/logic/CClientGame.cpp:378 -msgid "Doing a drive-by in" +#: Client/core/CSettings.cpp:4801 +msgid "Very experimental feature." msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:379 -msgid "Blub blub..." +#: Client/core/CSettings.cpp:4803 +msgid "Stops stalls with CJ variations (Uses 65MB more RAM)" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:380 -msgid "Breathing water" +#: Client/core/CSettings.cpp:4805 +msgid "Older routers may require a slower scan speed." msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:381 -msgid "Drowning in" +#: Client/core/CSettings.cpp:4807 +msgid "Switch on to use only one connection when downloading." msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:382 -msgid "Ducking for cover in" +#: Client/core/CSettings.cpp:4809 +msgid "Tag network packets to help ISPs identify MTA traffic." msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:383 -msgid "Fighting in" +#: Client/core/CSettings.cpp:4811 +msgid "Spinning circle animation at the bottom of the screen" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:384 -msgid "Throwing fists in" +#: Client/core/CSettings.cpp:4813 +msgid "Select default always. (This setting is not saved)" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:385 -msgid "Blastin' fools in" +#: Client/core/CSettings.cpp:4815 +msgid "Maximum is usually best" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:386 -msgid "Shooting up" +#: Client/core/CSettings.cpp:4817 Client/core/CSettings.cpp:4819 +msgid "Auto updater:" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:387 -msgid "Jetpacking in" +#: Client/core/CSettings.cpp:4817 +msgid "Select default unless you like filling out bug reports." msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:388 -msgid "Literally on fire in" +#: Client/core/CSettings.cpp:4819 +msgid "Select default to automatically install important updates." msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:389 -msgid "Burning up in" +#: Client/core/CSettings.cpp:4821 +msgid "16-bit color:" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:390 -msgid "Swimming in" +#: Client/core/CSettings.cpp:4821 +msgid "Enable 16 bit color modes - Requires MTA restart" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:391 -msgid "Floating around in" +#: Client/core/CSettings.cpp:4823 +msgid "Mouse fix:" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:392 -msgid "Being chased by a shark" +#: Client/core/CSettings.cpp:4823 +msgid "Mouse movement fix - May need PC restart" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:393 -msgid "Choking to death in" +#. Unknown command +#: Client/core/CCommands.cpp:216 +msgid "Unknown command or cvar: " msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:651 -msgid "Entering the game ..." +#: Client/core/CKeyBinds.cpp:186 +msgid "Fire" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:709 -msgid "" -"Not connected; please use Quick Connect or the 'connect' command to connect " -"to a server." +#: Client/core/CKeyBinds.cpp:187 +msgid "Next weapon" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:755 -msgid "Could not start the local server. See console for details." +#: Client/core/CKeyBinds.cpp:188 +msgid "Previous weapon" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:765 -#: Client/mods/deathmatch/logic/CClientGame.cpp:1237 -msgid "Local Server" +#: Client/core/CKeyBinds.cpp:189 +msgid "Forwards" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:765 -msgid "Starting local server ..." +#: Client/core/CKeyBinds.cpp:190 +msgid "Backwards" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:1013 -msgid "Area 51" +#: Client/core/CKeyBinds.cpp:193 +msgid "Zoom in" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:1022 -msgid "Walking around " +#: Client/core/CKeyBinds.cpp:194 +msgid "Zoom out" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:1168 -#, c-format -msgid "You were kicked from the game ( %s )" +#: Client/core/CKeyBinds.cpp:195 +msgid "Enter/Exit" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:1237 -msgid "Connecting to local server..." +#: Client/core/CKeyBinds.cpp:196 +msgid "Change camera" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:1248 -msgid "Error connecting to server." +#. 10 +#: Client/core/CKeyBinds.cpp:197 +msgid "Jump" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:1258 -msgid "Connecting to local server timed out. See console for details." +#: Client/core/CKeyBinds.cpp:198 +msgid "Sprint" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:1364 -msgid "Connection with the server was lost" +#: Client/core/CKeyBinds.cpp:199 +msgid "Look behind" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:1391 -msgid "Disconnected: the server is currently full" +#: Client/core/CKeyBinds.cpp:200 +msgid "Crouch" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:1403 -msgid "Disconnected: invalid password specified" +#: Client/core/CKeyBinds.cpp:201 +msgid "Action" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:1425 -msgid "MTA Client verification failed!" +#: Client/core/CKeyBinds.cpp:202 +msgid "Walk" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:5683 -msgid "In a ditch" +#: Client/core/CKeyBinds.cpp:203 +msgid "Vehicle fire" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:5683 -msgid "En-route to hospital" +#: Client/core/CKeyBinds.cpp:204 +msgid "Vehicle secondary fire" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:5683 -msgid "Meeting their maker" +#: Client/core/CKeyBinds.cpp:205 +msgid "Vehicle left" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:5684 -msgid "Regretting their decisions" +#: Client/core/CKeyBinds.cpp:206 +msgid "Vehicle right" msgstr "" -#: Client/mods/deathmatch/logic/CClientGame.cpp:5684 -msgid "Wasted" +#. 20 +#: Client/core/CKeyBinds.cpp:207 +msgid "Steer forwards/down" msgstr "" -#: Client/mods/deathmatch/logic/CLocalServer.cpp:37 -msgid "HOST GAME" +#: Client/core/CKeyBinds.cpp:208 +msgid "Steer backwards/up" msgstr "" -#. m_pTabs->CreateTab ( "Gamemode" ); -#: Client/mods/deathmatch/logic/CLocalServer.cpp:53 -msgid "Resources" +#: Client/core/CKeyBinds.cpp:209 +msgid "Accelerate" msgstr "" -#: Client/mods/deathmatch/logic/CLocalServer.cpp:55 -#: Client/mods/deathmatch/logic/CLocalServer.cpp:57 -msgid "Server name:" +#: Client/core/CKeyBinds.cpp:210 +msgid "Brake/Reverse" msgstr "" -#: Client/mods/deathmatch/logic/CLocalServer.cpp:64 -#: Client/mods/deathmatch/logic/CLocalServer.cpp:66 -msgid "Password:" +#: Client/core/CKeyBinds.cpp:211 +msgid "Radio next" msgstr "" -#: Client/mods/deathmatch/logic/CLocalServer.cpp:73 -#: Client/mods/deathmatch/logic/CLocalServer.cpp:75 -msgid "Max players:" +#: Client/core/CKeyBinds.cpp:212 +msgid "Radio previous" msgstr "" -#: Client/mods/deathmatch/logic/CLocalServer.cpp:82 -#: Client/mods/deathmatch/logic/CLocalServer.cpp:84 -msgid "Broadcast:" +#: Client/core/CKeyBinds.cpp:213 +msgid "Radio user track skip" msgstr "" -#: Client/mods/deathmatch/logic/CLocalServer.cpp:86 -msgid "LAN" +#: Client/core/CKeyBinds.cpp:214 +msgid "Horn" msgstr "" -#: Client/mods/deathmatch/logic/CLocalServer.cpp:99 -msgid "Selected" +#: Client/core/CKeyBinds.cpp:215 +msgid "Sub-mission" msgstr "" -#: Client/mods/deathmatch/logic/CLocalServer.cpp:116 -msgid "All" +#: Client/core/CKeyBinds.cpp:216 +msgid "Handbrake" msgstr "" -#: Client/mods/deathmatch/logic/CLocalServer.cpp:118 -msgid "Start" +#. 30 +#: Client/core/CKeyBinds.cpp:217 +msgid "Vehicle look left" msgstr "" -#: Client/loader/Dialogs.cpp:134 -msgid "Quit" +#: Client/core/CKeyBinds.cpp:218 +msgid "Vehicle look right" msgstr "" -#: Client/loader/Dialogs.cpp:151 -msgid "MTA: San Andreas has encountered a problem" +#: Client/core/CKeyBinds.cpp:219 +msgid "Vehicle look behind" msgstr "" -#: Client/loader/Dialogs.cpp:152 -msgid "Crash information" +#: Client/core/CKeyBinds.cpp:220 +msgid "Vehicle mouse look" msgstr "" -#: Client/loader/Dialogs.cpp:153 -msgid "" -"Tick the check box to send this crash info to MTA devs using the 'internet'" +#: Client/core/CKeyBinds.cpp:221 +msgid "Special control left" msgstr "" -#: Client/loader/Dialogs.cpp:154 -msgid "Doing so will increase the chance of this crash being fixed." +#: Client/core/CKeyBinds.cpp:222 +msgid "Special control right" msgstr "" -#: Client/loader/Dialogs.cpp:155 -msgid "Do you want to restart MTA: San Andreas ?" +#: Client/core/CKeyBinds.cpp:223 +msgid "Special control down" msgstr "" -#: Client/loader/Dialogs.cpp:162 -msgid "MTA: San Andreas - Warning" +#: Client/core/CKeyBinds.cpp:224 +msgid "Special control up" msgstr "" -#: Client/loader/Dialogs.cpp:163 -msgid "" -"Your Grand Theft Auto: San Andreas install directory contains these files:" +#: Client/core/CKeyBinds.cpp:225 +msgid "Aim weapon" msgstr "" -#: Client/loader/Dialogs.cpp:165 -msgid "" -"These files are not required and may interfere with the graphical features " -"in this version of MTA:SA.\n" -"\n" -"It is recommended that you remove or rename these files." +#: Client/core/CKeyBinds.cpp:226 +msgid "Conversation yes" msgstr "" -#: Client/loader/Dialogs.cpp:167 -msgid "Keep these files, but also show this warning on next start" +#. 40 +#: Client/core/CKeyBinds.cpp:227 +msgid "Conversation no" msgstr "" -#: Client/loader/Dialogs.cpp:168 -msgid "Do not remind me about these files again" +#: Client/core/CKeyBinds.cpp:228 +msgid "Group control forwards" msgstr "" -#: Client/loader/Dialogs.cpp:169 -msgid "Rename these files from *.dll to *.dll.bak" +#: Client/core/CKeyBinds.cpp:229 +msgid "Group control backwards" msgstr "" -#: Client/loader/Dialogs.cpp:170 -msgid "Show me these files" +#: Client/core/CVersionUpdater.cpp:626 +msgid "Busy" msgstr "" -#: Client/loader/Dialogs.cpp:171 -msgid "Play MTA:SA" +#: Client/core/CVersionUpdater.cpp:626 +msgid "Can't check for updates right now" msgstr "" -#: Client/loader/Dialogs.cpp:177 -msgid "MTA: San Andreas - Confusing options" +#: Client/core/CVersionUpdater.cpp:1567 Client/core/CVersionUpdater.cpp:1587 +#: Client/core/CVersionUpdater.cpp:1605 +#, c-format +msgid "MTA:SA %s required" msgstr "" -#: Client/loader/Dialogs.cpp:178 -msgid "NVidia Optimus detected!" +#: Client/core/CVersionUpdater.cpp:1568 +#, c-format +msgid "" +"An updated version of MTA:SA %s is required to join the selected server.\n" +"\n" +"Do you want to download and install MTA:SA %s ?" msgstr "" -#: Client/loader/Dialogs.cpp:179 -msgid "Try each option and see what works:" +#: Client/core/CVersionUpdater.cpp:1588 +#, c-format +msgid "Do you want to launch MTA:SA %s and connect to this server ?" msgstr "" -#: Client/loader/Dialogs.cpp:180 -msgid "A - Standard NVidia" +#: Client/core/CVersionUpdater.cpp:1606 +msgid "" +"It is not possible to connect at this time.\n" +"\n" +"Please try later." msgstr "" -#: Client/loader/Dialogs.cpp:181 -msgid "B - Alternate NVidia" +#: Client/core/CVersionUpdater.cpp:1788 +msgid "Connecting" msgstr "" -#: Client/loader/Dialogs.cpp:182 -msgid "C - Standard Intel" +#: Client/core/CVersionUpdater.cpp:1789 Client/core/CVersionUpdater.cpp:1805 +msgid "Please wait..." msgstr "" -#: Client/loader/Dialogs.cpp:183 -msgid "D - Alternate Intel" +#: Client/core/CVersionUpdater.cpp:1804 +msgid "CHECKING" msgstr "" -#: Client/loader/Dialogs.cpp:184 -msgid "If you get desperate, this might help:" +#: Client/core/CVersionUpdater.cpp:1821 Client/core/CVersionUpdater.cpp:1914 +msgid "UPDATE CHECK" msgstr "" -#: Client/loader/Dialogs.cpp:185 -msgid "If you have already selected an option that works, this might help:" +#: Client/core/CVersionUpdater.cpp:1822 +msgid "No update needed" msgstr "" -#: Client/loader/Dialogs.cpp:186 -msgid "Force windowed mode" +#: Client/core/CVersionUpdater.cpp:1839 +msgid "DOWNLOADING" msgstr "" -#: Client/loader/Dialogs.cpp:187 -msgid "Don't show again" +#: Client/core/CVersionUpdater.cpp:1840 +msgid "waiting..." msgstr "" -#: Client/loader/Dialogs.cpp:195 -msgid "Warning: Could not detect anti-virus product" +#: Client/core/CVersionUpdater.cpp:1856 +msgid "MANDATORY UPDATE" msgstr "" -#: Client/loader/Dialogs.cpp:197 +#: Client/core/CVersionUpdater.cpp:1857 msgid "" -"MTA could not detect an anti-virus on your PC.\n" -"\n" -"Viruses interfere with MTA and degrade your gameplay experience.\n" +"To join this server, you must update MTA.\n" "\n" -"Press 'Help' for more information." +" Do you want to update now ?" msgstr "" -#: Client/loader/Dialogs.cpp:200 -msgid "I have already installed an anti-virus" +#: Client/core/CVersionUpdater.cpp:1875 +msgid "OPTIONAL UPDATE" msgstr "" -#: Client/loader/Dialogs.cpp:202 +#: Client/core/CVersionUpdater.cpp:1876 msgid "" -"I will not install an anti-virus.\n" -"I want my PC to lag and be part of a botnet." +"Server says an update is recommended, but not essential.\n" +"\n" +" Do you want to update now ?" msgstr "" -#: Client/loader/Dialogs.cpp:890 Client/loader/Utils.cpp:534 -msgid "Searching for Grand Theft Auto San Andreas" +#: Client/core/CVersionUpdater.cpp:1915 +msgid "" +"Update not currently avalable.\n" +"\n" +"Please check www.mtasa.com" msgstr "" -#: Client/loader/Dialogs.cpp:893 Client/loader/Utils.cpp:536 -msgid "Please start Grand Theft Auto San Andreas" +#: Client/core/CVersionUpdater.cpp:1936 Client/core/CVersionUpdater.cpp:2118 +msgid "ERROR SAVING" +msgstr "" + +#: Client/core/CVersionUpdater.cpp:1937 Client/core/CVersionUpdater.cpp:2119 +msgid "Unable to create the file." msgstr "" -#: Client/loader/Dialogs.cpp:901 Client/loader/Install.cpp:852 -msgid "Installing update..." +#: Client/core/CVersionUpdater.cpp:1945 Client/core/CVersionUpdater.cpp:1954 +#: Client/core/CVersionUpdater.cpp:2127 Client/core/CVersionUpdater.cpp:2136 +msgid "ERROR DOWNLOADING" msgstr "" -#: Client/loader/Dialogs.cpp:909 Client/loader/Install.cpp:934 -msgid "Extracting files..." +#: Client/core/CVersionUpdater.cpp:1946 Client/core/CVersionUpdater.cpp:2128 +msgid "The downloaded file appears to be incorrect." msgstr "" -#: Client/loader/Dialogs.cpp:914 Client/loader/Utils.cpp:1394 -msgid "Copying files..." +#: Client/core/CVersionUpdater.cpp:1955 Client/core/CVersionUpdater.cpp:2137 +msgid "For some reason." msgstr "" -#: Client/loader/Dialogs.cpp:919 Client/loader/Utils.cpp:1454 -msgid "Copy finished early. Everything OK." +#: Client/core/CVersionUpdater.cpp:1966 Client/core/CVersionUpdater.cpp:2150 +msgid "DOWNLOAD COMPLETE" msgstr "" -#: Client/loader/Dialogs.cpp:924 Client/loader/Utils.cpp:1460 -msgid "Finishing..." +#: Client/core/CVersionUpdater.cpp:1990 +msgid " - Unknown problem in _DialogUpdateResult" msgstr "" -#: Client/loader/Dialogs.cpp:928 Client/loader/Utils.cpp:1462 -msgid "Done!" +#: Client/core/CVersionUpdater.cpp:2088 Client/core/CVersionUpdater.cpp:2098 +msgid "Ok" msgstr "" -#: Client/loader/Utils.cpp:600 -msgid "Select your Grand Theft Auto: San Andreas Installation Directory" +#: Client/core/CVersionUpdater.cpp:2096 +msgid "ERROR" msgstr "" -#: Client/loader/Utils.cpp:968 Client/loader/CInstallManager.cpp:361 -#, c-format +#: Client/core/CVersionUpdater.cpp:2097 msgid "" -"MTA:SA needs Administrator access for the following task:\n" +"Some MTA:SA data files are missing.\n" "\n" -" '%s'\n" "\n" -"Please confirm in the next window." +"Please reinstall MTA:SA" msgstr "" -#: Client/loader/Utils.cpp:1069 +#: Client/core/CVersionUpdater.cpp:2774 #, c-format -msgid "Error loading %s module! (%s)" +msgid "%3d %% completed" msgstr "" -#: Client/loader/Utils.cpp:1502 +#: Client/core/CVersionUpdater.cpp:2777 #, c-format msgid "" -"New installation of %s detected.\n" "\n" -"Do you want to copy your settings from %s ?" +"\n" +"Waiting for response - %-3d" msgstr "" -#: Client/loader/Utils.cpp:1541 -#, c-format -msgid "GTA:SA had trouble opening the file '%s'" +#: Client/core/CCommandFuncs.cpp:24 +msgid "***[ COMMAND HELP ]***\n" msgstr "" -#: Client/loader/Utils.cpp:1563 +#: Client/core/CCommandFuncs.cpp:158 #, c-format -msgid "GTA:SA is missing the file '%s'." +msgid "* The time is %d:%02d:%02d" msgstr "" -#: Client/loader/Utils.cpp:1588 -msgid "GTA:SA had trouble loading a model." +#: Client/core/CCommandFuncs.cpp:242 +msgid "connect: Syntax is 'connect [ ]'" msgstr "" -#: Client/loader/Utils.cpp:1590 -msgid "If you recently modified gta3.img, then try reinstalling GTA:SA." +#: Client/core/CCommandFuncs.cpp:250 Client/core/CCommandFuncs.cpp:318 +msgid "connect: Bad port number" msgstr "" -#: Client/loader/Utils.cpp:1615 -msgid "GTA:SA had trouble adding an upgrade to a vehicle." +#: Client/core/CCommandFuncs.cpp:272 Client/core/CCommandFuncs.cpp:333 +#, c-format +msgid "connect: Connecting to %s:%u..." msgstr "" -#: Client/loader/Utils.cpp:1634 +#: Client/core/CCommandFuncs.cpp:276 Client/core/CCommandFuncs.cpp:337 #, c-format -msgid "GTA:SA found errors in the file '%s'" +msgid "connect: could not connect to %s:%u!" msgstr "" -#: Client/loader/Utils.cpp:1716 -msgid "Did your computer restart when playing MTA:SA?" +#: Client/core/CCommandFuncs.cpp:281 +msgid "connect: Failed to unload current mod" msgstr "" -#: Client/loader/Utils.cpp:1781 -msgid "Please terminate the following programs before continuing:" +#: Client/core/CCommandFuncs.cpp:371 +msgid "Bound all controls from GTA" msgstr "" -#: Client/loader/MainFunctions.cpp:248 -msgid "" -"Trouble restarting MTA:SA\n" -"\n" -"If the problem persists, open Task Manager and\n" -"stop the 'gta_sa.exe' and 'Multi Theft Auto.exe' processes\n" -"\n" -"\n" -"Try to launch MTA:SA again?" +#: Client/core/CCommandFuncs.cpp:385 +msgid "Saved configuration file" msgstr "" -#: Client/loader/MainFunctions.cpp:266 -msgid "" -"Another instance of MTA is already running.\n" -"\n" -"If this problem persists, please restart your computer" +#. Print it +#: Client/core/CCommandFuncs.cpp:451 +#, c-format +msgid "* Your serial is: %s" msgstr "" -#: Client/loader/MainFunctions.cpp:269 +#. Even the default skin doesn't work, so give up +#: Client/core/CGUI.cpp:86 msgid "" -"Another instance of MTA is already running.\n" -"\n" -"Do you want to terminate it?" +"The skin you selected could not be loaded, and the default skin also could " +"not be loaded, please reinstall MTA." msgstr "" -#: Client/loader/MainFunctions.cpp:294 -msgid "" -"Are you having problems running MTA:SA?.\n" -"\n" -"Do you want to revert to an earlier version?" +#. Create the window +#: Client/core/CNewsBrowser.cpp:153 +msgid "NEWS" msgstr "" -#: Client/loader/MainFunctions.cpp:324 -msgid "" -"There seems to be a problem launching MTA:SA.\n" -"Resetting GTA settings can sometimes fix this problem.\n" -"\n" -"Do you want to reset GTA settings now?" +#. News link +#: Client/core/CNewsBrowser.cpp:171 Client/core/CNewsBrowser.cpp:172 +msgid "Visit latest news article" msgstr "" -#: Client/loader/MainFunctions.cpp:339 +#: Client/core/DXHook/CDirect3DHook9.cpp:124 msgid "" -"GTA settings have been reset.\n" +"Could not initialize Direct3D9.\n" "\n" -"Press OK to continue." +"Please ensure the DirectX End-User Runtime and\n" +"latest Windows Service Packs are installed correctly." msgstr "" -#: Client/loader/MainFunctions.cpp:344 -#, c-format -msgid "File could not be deleted: '%s'" +#. Create queue window +#: Client/core/ServerBrowser/CServerInfo.cpp:32 +#: Client/core/ServerBrowser/CServerInfo.cpp:302 +msgid "SERVER IS FULL" msgstr "" -#. No settings to delete, or can't find them -#: Client/loader/MainFunctions.cpp:352 -msgid "" -"Are you having problems running MTA:SA?.\n" -"\n" -"Do you want to see some online help?" +#. Determine our label draw position for L10n +#. Start position +#. Server Name +#: Client/core/ServerBrowser/CServerInfo.cpp:44 +#: Client/core/ServerBrowser/CServerInfo.cpp:53 +msgid "Name:" msgstr "" -#. Inform user -#: Client/loader/MainFunctions.cpp:388 -msgid "" -"Are you having problems running MTA:SA?.\n" -"\n" -"Do you want to change the following setting?" +#. Server IP +#: Client/core/ServerBrowser/CServerInfo.cpp:44 +#: Client/core/ServerBrowser/CServerInfo.cpp:64 +msgid "Server Address:" msgstr "" -#: Client/loader/MainFunctions.cpp:431 -msgid "" -"Are you having problems running MTA:SA?.\n" -"\n" -"Try disabling the following products for GTA and MTA:" +#. Gamemode +#: Client/core/ServerBrowser/CServerInfo.cpp:44 +#: Client/core/ServerBrowser/CServerInfo.cpp:75 +msgid "Gamemode:" msgstr "" -#: Client/loader/MainFunctions.cpp:465 -msgid "" -"WARNING\n" -"\n" -"MTA:SA has detected unusual activity.\n" -"Please run a virus scan to ensure your system is secure.\n" -"\n" +#. Map +#: Client/core/ServerBrowser/CServerInfo.cpp:44 +#: Client/core/ServerBrowser/CServerInfo.cpp:86 +msgid "Map:" msgstr "" -#: Client/loader/MainFunctions.cpp:468 -#, c-format -msgid "The detected file was: %s\n" +#. Players +#: Client/core/ServerBrowser/CServerInfo.cpp:45 +#: Client/core/ServerBrowser/CServerInfo.cpp:97 +msgid "Players:" msgstr "" -#: Client/loader/MainFunctions.cpp:602 -msgid "" -"An instance of GTA: San Andreas is already running. It needs to be " -"terminated before MTA:SA can be started. Do you want to do that now?" +#. Passworded +#: Client/core/ServerBrowser/CServerInfo.cpp:45 +#: Client/core/ServerBrowser/CServerInfo.cpp:108 +msgid "Passworded:" msgstr "" -#: Client/loader/MainFunctions.cpp:609 -msgid "" -"Unable to terminate GTA: San Andreas. If the problem persists, please " -"restart your computer." +#. Latency +#: Client/core/ServerBrowser/CServerInfo.cpp:45 +#: Client/core/ServerBrowser/CServerInfo.cpp:119 +msgid "Latency:" msgstr "" -#: Client/loader/MainFunctions.cpp:632 -msgid "" -"Registry entries are missing. Please reinstall Multi Theft Auto: San Andreas." +#. Column for player names +#. Player List Columns +#: Client/core/ServerBrowser/CServerInfo.cpp:138 +#: Client/core/ServerBrowser/CServerBrowser.cpp:478 +msgid "Player list" msgstr "" -#: Client/loader/MainFunctions.cpp:638 -msgid "" -"The path to your installation of GTA: San Andreas contains unsupported " -"(unicode) characters. Please move your Grand Theft Auto: San Andreas " -"installation to a compatible path that contains only standard ASCII " -"characters and reinstall Multi Theft Auto: San Andreas." +#. Close button +#: Client/core/ServerBrowser/CServerInfo.cpp:144 +msgid "Close" msgstr "" -#: Client/loader/MainFunctions.cpp:648 -msgid "" -"The path to your installation of 'MTA:SA' or 'GTA: San Andreas'\n" -"contains a ';' (semicolon).\n" -"\n" -" If you experience problems when running MTA:SA,\n" -" move your installation(s) to a path that does not contain a semicolon." +#. Join Game button +#: Client/core/ServerBrowser/CServerInfo.cpp:152 +msgid "Join Game" msgstr "" -#: Client/loader/MainFunctions.cpp:810 -msgid "" -"Load failed. Please ensure that the latest data files have been installed " -"correctly." +#. Please enter password label +#: Client/core/ServerBrowser/CServerInfo.cpp:166 +msgid "Please enter the password to the server:" msgstr "" -#: Client/loader/MainFunctions.cpp:819 -#, c-format -msgid "Load failed. Please ensure that %s is installed correctly." +#: Client/core/ServerBrowser/CServerInfo.cpp:177 +msgid "Join the server as soon as a player slot is available." msgstr "" -#: Client/loader/MainFunctions.cpp:826 -#, c-format -msgid "Load failed. Could not find gta_sa.exe in %s." +#: Client/core/ServerBrowser/CServerInfo.cpp:310 +msgid "PLEASE ENTER SERVER PASSWORD" msgstr "" -#: Client/loader/MainFunctions.cpp:836 -#, c-format -msgid "" -"Load failed. %s exists in the GTA directory. Please delete before continuing." +#. The server has timed out +#: Client/core/ServerBrowser/CServerInfo.cpp:402 +msgid "Timed Out" +msgstr "" + +#. Set every GUI elements text to blank +#: Client/core/ServerBrowser/CServerInfo.cpp:431 +msgid "Querying..." msgstr "" -#: Client/loader/MainFunctions.cpp:845 -#, c-format -msgid "Main file has an incorrect name (%s)" +#. Create the window +#: Client/core/ServerBrowser/CServerBrowser.cpp:85 +msgid "SERVER BROWSER" msgstr "" -#: Client/loader/MainFunctions.cpp:856 -msgid "" -"Main file is unsigned. Possible virus activity.\n" -"\n" -"See online help if MTA does not work correctly." +#: Client/core/ServerBrowser/CServerBrowser.cpp:134 +msgid "Local" msgstr "" -#: Client/loader/MainFunctions.cpp:882 -#, c-format -msgid "" -"Data file %s is missing. Possible virus activity.\n" -"\n" -"Consider reinstalling Multi Theft Auto for your security.\n" -"See online help if MTA does not work correctly." +#: Client/core/ServerBrowser/CServerBrowser.cpp:135 +msgid "Favourites" msgstr "" -#: Client/loader/MainFunctions.cpp:893 -#, c-format -msgid "" -"Data file %s is modified. Possible virus activity.\n" -"\n" -"Consider reinstalling Multi Theft Auto for your security.\n" -"See online help if MTA does not work correctly." +#: Client/core/ServerBrowser/CServerBrowser.cpp:136 +msgid "Recent" msgstr "" -#: Client/loader/MainFunctions.cpp:907 +#: Client/core/ServerBrowser/CServerBrowser.cpp:191 msgid "" -".asi files are in the 'MTA:SA' or 'GTA: San Andreas' installation " -"directory.\n" +"FOR QUICK CONNECT:\n" "\n" -"Remove these .asi files if you experience problems with MTA:SA." +"Type the address and port into the address bar.\n" +"Or select a server from the history list and press 'Connect'" msgstr "" -#: Client/loader/MainFunctions.cpp:1009 -msgid "" -"File version mismatch error. Reinstall MTA:SA if you experience problems.\n" +#: Client/core/ServerBrowser/CServerBrowser.cpp:203 +msgid "HELP" msgstr "" -#: Client/loader/MainFunctions.cpp:1018 -msgid "Some files are missing. Reinstall MTA:SA if you experience problems.\n" +#: Client/core/ServerBrowser/CServerBrowser.cpp:212 +#: Client/core/ServerBrowser/CServerBrowser.cpp:252 +msgid "Refresh" msgstr "" -#: Client/loader/MainFunctions.cpp:1030 -msgid "" -"MTA:SA is not compatible with Windows 'Safe Mode'.\n" -"\n" -"Please restart your PC.\n" +#: Client/core/ServerBrowser/CServerBrowser.cpp:212 +#: Client/core/ServerBrowser/CServerBrowser.cpp:253 +msgid "Add Favorite" msgstr "" -#: Client/loader/MainFunctions.cpp:1123 -msgid "Fix configuration issue" +#: Client/core/ServerBrowser/CServerBrowser.cpp:212 +#: Client/core/ServerBrowser/CServerBrowser.cpp:254 +#: Client/core/ServerBrowser/CServerBrowser.cpp:301 +#: Client/core/ServerBrowser/CServerBrowser.cpp:372 +msgid "Connect" msgstr "" -#. Try to relaunch as admin if not done so already -#: Client/loader/MainFunctions.cpp:1157 -msgid "Fix elevation required error" +#: Client/core/ServerBrowser/CServerBrowser.cpp:212 +#: Client/core/ServerBrowser/CServerBrowser.cpp:255 +msgid "Server information" msgstr "" -#: Client/loader/MainFunctions.cpp:1164 -#, c-format -msgid "" -"Could not start Grand Theft Auto: San Andreas. Please try restarting, or if " -"the problem persists,contact MTA at www.multitheftauto.com. \n" -"\n" -"[%s]" +#: Client/core/ServerBrowser/CServerBrowser.cpp:213 +#: Client/core/ServerBrowser/CServerBrowser.cpp:256 +msgid "Search servers" msgstr "" -#: Client/loader/MainFunctions.cpp:1219 -msgid "" -"GTA: San Andreas may not have launched correctly. Do you want to terminate " -"it?" +#: Client/core/ServerBrowser/CServerBrowser.cpp:213 +#: Client/core/ServerBrowser/CServerBrowser.cpp:257 +msgid "Search players" msgstr "" -#: Client/loader/CInstallManager.cpp:376 -#, c-format -msgid "" -"MTA:SA could not complete the following task:\n" -"\n" -" '%s'\n" +#: Client/core/ServerBrowser/CServerBrowser.cpp:213 +#: Client/core/ServerBrowser/CServerBrowser.cpp:258 +msgid "Start search" msgstr "" -#: Client/loader/CInstallManager.cpp:426 -msgid "" -"** The crash was caused by a graphics driver error **\n" -"\n" -"** Please update your graphics drivers **" +#: Client/core/ServerBrowser/CServerBrowser.cpp:299 +#: Client/core/ServerBrowser/CServerBrowser.cpp:1697 +msgid "Search players..." msgstr "" -#: Client/loader/CInstallManager.cpp:532 -msgid "Install updated MTA:SA files" +#: Client/core/ServerBrowser/CServerBrowser.cpp:422 +#: Client/core/ServerBrowser/CServerBrowser.cpp:1695 +msgid "Search servers..." msgstr "" -#: Client/loader/CInstallManager.cpp:552 -msgid "" -"Could not update due to file conflicts. Please close other applications and " -"retry" +#: Client/core/ServerBrowser/CServerBrowser.cpp:453 +msgid "Name" msgstr "" -#: Client/loader/CInstallManager.cpp:561 -#, c-format -msgid "Multi Theft Auto has not been installed properly, please reinstall. %s" +#: Client/core/ServerBrowser/CServerBrowser.cpp:454 +msgid "Players" msgstr "" -#: Client/loader/CInstallManager.cpp:613 -msgid "Create GTA:SA junctions" +#: Client/core/ServerBrowser/CServerBrowser.cpp:455 +msgid "Ping" msgstr "" -#: Client/loader/CInstallManager.cpp:657 -msgid "MTA:SA cannot launch because copying a file failed:" +#: Client/core/ServerBrowser/CServerBrowser.cpp:456 +msgid "Gamemode" msgstr "" -#: Client/loader/CInstallManager.cpp:663 Client/loader/CInstallManager.cpp:703 -msgid "MTA:SA cannot launch because an MTA:SA file is incorrect or missing:" +#. Include label +#: Client/core/ServerBrowser/CServerBrowser.cpp:486 +msgid "Include:" msgstr "" -#: Client/loader/CInstallManager.cpp:672 -msgid "Copy MTA:SA files" +#: Client/core/ServerBrowser/CServerBrowser.cpp:492 +msgid "Empty" msgstr "" -#: Client/loader/CInstallManager.cpp:695 Client/loader/CInstallManager.cpp:773 -msgid "MTA:SA cannot launch because a GTA:SA file is incorrect or missing:" +#: Client/core/ServerBrowser/CServerBrowser.cpp:498 +msgid "Full" msgstr "" -#: Client/loader/CInstallManager.cpp:780 -msgid "Patch GTA:SA dependency" +#: Client/core/ServerBrowser/CServerBrowser.cpp:504 +msgid "Locked" msgstr "" -#: Client/loader/CInstallManager.cpp:828 -msgid "" -"MTA:SA cannot launch because the GTA:SA executable is incorrect or missing:" +#: Client/core/ServerBrowser/CServerBrowser.cpp:516 +msgid "Offline" msgstr "" -#: Client/loader/CInstallManager.cpp:832 -msgid "" -"Please check your anti-virus for a false-positive detection, try to add an " -"exception for the GTA:SA executable and restart MTA:SA." +#: Client/core/ServerBrowser/CServerBrowser.cpp:529 +msgid "Other Versions" msgstr "" -#: Client/loader/CInstallManager.cpp:838 -msgid "Generate GTA:SA" +#: Client/core/ServerBrowser/CServerBrowser.cpp:550 +msgid "Back" msgstr "" -#: Client/loader/CInstallManager.cpp:853 -msgid "MTA:SA cannot launch because the GTA:SA executable is not loadable:" +#: Client/core/ServerBrowser/CServerBrowser.cpp:741 +msgid "Loading..." msgstr "" -#: Client/loader/CInstallManager.cpp:860 Client/loader/CInstallManager.cpp:883 -msgid "Patch GTA:SA" +#: Client/core/ServerBrowser/CServerBrowser.cpp:1240 +#: Client/core/ServerBrowser/CServerBrowser.cpp:2182 +msgid " ..loading.." msgstr "" -#: Client/loader/CInstallManager.cpp:876 -msgid "MTA:SA cannot launch because patching GTA:SA has failed:" +#: Client/core/ServerBrowser/CServerBrowser.cpp:1278 +#: Client/core/ServerBrowser/CServerBrowser.cpp:1406 +msgid "No address specified!" msgstr "" -#: Client/loader/CInstallManager.cpp:1113 -msgid "Missing file:" +#: Client/core/ServerBrowser/CServerBrowser.cpp:1291 +msgid "Unknown protocol" msgstr "" -#: Client/loader/CInstallManager.cpp:1117 -msgid "If MTA fails to load, please re-install GTA:SA" +#: Client/core/ServerBrowser/CServerBrowser.cpp:1291 +msgid "Please use the mtasa:// protocol!" msgstr "" -#: Client/loader/CInstallManager.cpp:1152 -msgid "Update install settings" +#: Client/core/ServerBrowser/CServerBrowser.cpp:1380 +msgid "You have to select a server to connect to." msgstr "" -#: Client/loader/CInstallManager.cpp:1291 -msgid "Update compatibility settings" +#: Client/core/ServerBrowser/CServerList.cpp:25 +msgid "Idle" msgstr "" -#: Client/loader/Install.cpp:265 -msgid "Unknown" -msgstr "" +#: Client/core/ServerBrowser/CServerList.cpp:150 +msgid "player" +msgid_plural "players" +msgstr[0] "" +msgstr[1] "" -#: Client/loader/Install.cpp:272 -#, c-format -msgid "" -"The file '%s' is currently locked by %zu processes.\n" -"\n" -"Do you want to terminate the following processes and continue updating?\n" -"\n" -"%s" +#: Client/core/ServerBrowser/CServerList.cpp:151 +msgid "on" msgstr "" -#: Client/loader/Install.cpp:479 -#, c-format -msgid "" -"Your installation may be corrupt now.\n" -"\n" -"%zu out of %zu files could not be restored from the backup.\n" -"\n" -"You should reinstall Multi Theft Auto from www.multitheftauto.com\n" -"or try running the update with administrator rights." -msgstr "" +#: Client/core/ServerBrowser/CServerList.cpp:154 +msgid "server" +msgid_plural "servers" +msgstr[0] "" +msgstr[1] "" -#. Couldn't create render target for CPostEffects -#: Client/multiplayer_sa/CMultiplayerSA_CrashFixHacks.cpp:1360 -msgid "Problem with graphics driver" +#. We are polling for the master server list (first pass) +#: Client/core/ServerBrowser/CServerList.cpp:238 +#, c-format +msgid "Requesting master server list (%lu ms elapsed)" msgstr "" -#: Client/cefweb/CWebsiteRequests.cpp:19 -msgid "Website requests" +#. Abort +#: Client/core/ServerBrowser/CServerList.cpp:254 +msgid "Master server list could not be parsed." msgstr "" -#: Client/cefweb/CWebsiteRequests.cpp:27 -msgid "" -"The server requests the following websites in order to load them (later):" +#. Abort +#: Client/core/ServerBrowser/CServerList.cpp:264 +msgid "Master server list could not be retrieved." msgstr "" -#: Client/cefweb/CWebsiteRequests.cpp:33 -msgid "NEVER ENTER SENSITIVE DATA TO PROTECT THEM FROM BEING STOLEN" +#: Client/core/ServerBrowser/CServerList.cpp:274 +msgid "(Backup server list)" msgstr "" -#: Client/cefweb/CWebsiteRequests.cpp:46 -msgid "Remember decision" +#: Client/core/ServerBrowser/CServerList.cpp:326 +msgid "Cannot bind LAN-broadcast socket" msgstr "" -#: Client/cefweb/CWebsiteRequests.cpp:57 -msgid "Deny" +#: Client/core/ServerBrowser/CServerList.cpp:345 +msgid "Attempting to discover LAN servers" msgstr "" #. Populate the message and show the box -#: Shared/mods/deathmatch/logic/Utils.cpp:109 +#: Shared/mods/deathmatch/logic/Utils.cpp:127 #, c-format msgid "" "Fatal error (%u). If this problem persists, please check out mtasa.com for " @@ -3293,14 +3295,14 @@ msgstr "" #. assert ( 0 ); #. #endif #. Populate the message and show the box -#: Shared/mods/deathmatch/logic/Utils.cpp:125 +#: Shared/mods/deathmatch/logic/Utils.cpp:143 #, c-format msgid "" "Protocol error (%u). If this problem persists, please check out mtasa.com " "for support." msgstr "" -#: Shared/mods/deathmatch/logic/Utils.cpp:127 +#: Shared/mods/deathmatch/logic/Utils.cpp:145 msgid "Connection error" msgstr "" diff --git a/Shared/installer/locale/en_US.pot b/Shared/installer/locale/en_US.pot index 8d401e2f8b..3af1c40ebd 100644 --- a/Shared/installer/locale/en_US.pot +++ b/Shared/installer/locale/en_US.pot @@ -3,7 +3,7 @@ msgid "" msgstr "" "Project-Id-Version: MTA San Andreas Installer 1.x\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-07 01:18\n" +"POT-Creation-Date: 2024-06-26 02:25\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -154,72 +154,72 @@ msgid "The client is the program you run to play on a Multi Theft Auto server" msgstr "" #. INST_CLIENTSERVER -#: Shared/installer/nightly.nsi:441 +#: Shared/installer/nightly.nsi:444 msgid "Client and Server" msgstr "" #. INST_SERVER -#: Shared/installer/nightly.nsi:442 +#: Shared/installer/nightly.nsi:445 msgid "Server only" msgstr "" #. INST_STARTMENU_GROUP -#: Shared/installer/nightly.nsi:456 +#: Shared/installer/nightly.nsi:459 msgid "Start menu group" msgstr "" #. INST_DESKTOP_ICON -#: Shared/installer/nightly.nsi:457 +#: Shared/installer/nightly.nsi:460 msgid "Desktop icon" msgstr "" #. INST_PROTOCOL -#: Shared/installer/nightly.nsi:458 +#: Shared/installer/nightly.nsi:461 msgid "Register mtasa:// protocol" msgstr "" #. INST_GAMES_EXPLORER -#: Shared/installer/nightly.nsi:459 +#: Shared/installer/nightly.nsi:462 msgid "Add to Games Explorer" msgstr "" #. INST_DIRECTX -#: Shared/installer/nightly.nsi:460 +#: Shared/installer/nightly.nsi:463 msgid "Install DirectX" msgstr "" #. INST_SEC_CLIENT -#: Shared/installer/nightly.nsi:494 +#: Shared/installer/nightly.nsi:497 msgid "Game client" msgstr "" #. INST_SEC_SERVER -#: Shared/installer/nightly.nsi:495 +#: Shared/installer/nightly.nsi:498 msgid "Dedicated server" msgstr "" #. INST_SEC_CORE -#: Shared/installer/nightly.nsi:496 +#: Shared/installer/nightly.nsi:499 msgid "Core components" msgstr "" #. INST_SEC_GAME -#: Shared/installer/nightly.nsi:497 +#: Shared/installer/nightly.nsi:500 msgid "Game module" msgstr "" #. INFO_INPLACE_UPGRADE -#: Shared/installer/nightly.nsi:499 +#: Shared/installer/nightly.nsi:502 msgid "Performing in-place upgrade..." msgstr "" #. INFO_UPDATE_PERMISSIONS -#: Shared/installer/nightly.nsi:500 +#: Shared/installer/nightly.nsi:503 msgid "Updating permissions. This could take a few minutes..." msgstr "" #. MSGBOX_INVALID_GTASA -#: Shared/installer/nightly.nsi:501 +#: Shared/installer/nightly.nsi:504 msgid "" "A valid Windows version of Grand Theft Auto: San Andreas was not detected.$\r" "$\n" @@ -229,44 +229,44 @@ msgid "" msgstr "" #. INST_SEC_CORE_RESOURCES -#: Shared/installer/nightly.nsi:504 +#: Shared/installer/nightly.nsi:507 msgid "Core Resources" msgstr "" #. INST_SEC_OPTIONAL_RESOURCES -#: Shared/installer/nightly.nsi:505 +#: Shared/installer/nightly.nsi:508 msgid "Optional Resources" msgstr "" #. INST_SEC_EDITOR -#: Shared/installer/nightly.nsi:506 +#: Shared/installer/nightly.nsi:509 msgid "Editor" msgstr "" #. INST_SEC_DEVELOPER -#: Shared/installer/nightly.nsi:980 +#: Shared/installer/nightly.nsi:983 msgid "Development" msgstr "" #. UNINST_SUCCESS -#: Shared/installer/nightly.nsi:1028 +#: Shared/installer/nightly.nsi:1031 msgid "$(^Name) was successfully removed from your computer." msgstr "" #. UNINST_FAIL -#: Shared/installer/nightly.nsi:1035 +#: Shared/installer/nightly.nsi:1038 msgid "Uninstallation has failed!" msgstr "" #. UNINST_REQUEST -#: Shared/installer/nightly.nsi:1043 +#: Shared/installer/nightly.nsi:1046 msgid "" "Are you sure you want to completely remove $(^Name) and all of its " "components?" msgstr "" #. UNINST_REQUEST_NOTE -#: Shared/installer/nightly.nsi:1044 +#: Shared/installer/nightly.nsi:1047 msgid "" "Uninstalling before update?$\r" "$\n" @@ -276,7 +276,7 @@ msgid "" msgstr "" #. UNINST_DATA_REQUEST -#: Shared/installer/nightly.nsi:1057 +#: Shared/installer/nightly.nsi:1060 msgid "" "Would you like to keep your data files (such as resources, screenshots and " "server configuration)? If you click no, any resources, configurations or " @@ -284,27 +284,27 @@ msgid "" msgstr "" #. UAC_RIGHTS1 -#: Shared/installer/nightly.nsi:1236 +#: Shared/installer/nightly.nsi:1243 msgid "This installer requires admin access, try again" msgstr "" #. UAC_RIGHTS_UN -#: Shared/installer/nightly.nsi:1237 +#: Shared/installer/nightly.nsi:1244 msgid "This uninstaller requires admin access, try again" msgstr "" #. UAC_RIGHTS3 -#: Shared/installer/nightly.nsi:1238 +#: Shared/installer/nightly.nsi:1245 msgid "Logon service not running, aborting!" msgstr "" #. UAC_RIGHTS4 -#: Shared/installer/nightly.nsi:1239 +#: Shared/installer/nightly.nsi:1246 msgid "Unable to elevate" msgstr "" #. INST_MTA_CONFLICT -#: Shared/installer/nightly.nsi:1835 +#: Shared/installer/nightly.nsi:1842 msgid "" "A different major version of MTA ($1) already exists at that path.$\n" "$\n" @@ -313,7 +313,7 @@ msgid "" msgstr "" #. INST_GTA_CONFLICT -#: Shared/installer/nightly.nsi:1839 +#: Shared/installer/nightly.nsi:1846 msgid "" "MTA cannot be installed into the same directory as GTA:SA.$\n" "$\n" @@ -322,7 +322,7 @@ msgid "" msgstr "" #. INST_GTA_ERROR1 -#: Shared/installer/nightly.nsi:1842 +#: Shared/installer/nightly.nsi:1849 msgid "" "The selected directory does not exist.$\n" "$\n" @@ -330,7 +330,7 @@ msgid "" msgstr "" #. INST_GTA_ERROR2 -#: Shared/installer/nightly.nsi:1844 +#: Shared/installer/nightly.nsi:1851 msgid "" "Could not find GTA:SA installed at $GTA_DIR $\n" "$\n" @@ -338,19 +338,19 @@ msgid "" msgstr "" #. INST_CHOOSE_LOC_TOP -#: Shared/installer/nightly.nsi:1962 +#: Shared/installer/nightly.nsi:1969 msgid "Choose Install Location" msgstr "" #. INST_CHOOSE_LOC -#: Shared/installer/nightly.nsi:1963 +#: Shared/installer/nightly.nsi:1970 msgid "" "Choose the folder in which to install ${PRODUCT_NAME_NO_VER} " "${PRODUCT_VERSION}" msgstr "" #. INST_CHOOSE_LOC2 -#: Shared/installer/nightly.nsi:1964 +#: Shared/installer/nightly.nsi:1971 msgid "" "${PRODUCT_NAME_NO_VER} ${PRODUCT_VERSION} will be installed in the following folder.$\n" "To install in a different folder, click Browse and select another folder.$\n" @@ -359,63 +359,63 @@ msgid "" msgstr "" #. INST_CHOOSE_LOC3 -#: Shared/installer/nightly.nsi:1966 +#: Shared/installer/nightly.nsi:1973 msgid "Destination Folder" msgstr "" #. INST_CHOOSE_LOC_BROWSE -#: Shared/installer/nightly.nsi:1967 +#: Shared/installer/nightly.nsi:1974 msgid "Browse..." msgstr "" #. INST_CHOOSE_LOC_DEFAULT -#: Shared/installer/nightly.nsi:1968 +#: Shared/installer/nightly.nsi:1975 msgid "Default" msgstr "" #. INST_CHOOSE_LOC_LAST_USED -#: Shared/installer/nightly.nsi:1969 +#: Shared/installer/nightly.nsi:1976 msgid "Last used" msgstr "" #. INST_CHOOSE_LOC_CUSTOM -#: Shared/installer/nightly.nsi:1970 +#: Shared/installer/nightly.nsi:1977 msgid "Custom" msgstr "" #. INST_CHOOSE_LOC4 -#: Shared/installer/nightly.nsi:2148 +#: Shared/installer/nightly.nsi:2155 msgid "" "Select the folder to install ${PRODUCT_NAME_NO_VER} ${PRODUCT_VERSION} in:" msgstr "" #. INST_LOC_OW -#: Shared/installer/nightly.nsi:2166 +#: Shared/installer/nightly.nsi:2173 msgid "" "Warning: A different major version of MTA ($1) already exists at that path." msgstr "" #. INST_LOC_UPGRADE -#: Shared/installer/nightly.nsi:2167 +#: Shared/installer/nightly.nsi:2174 msgid "Installation type: Upgrade" msgstr "" #. NETTEST_TITLE1 -#: Shared/installer/nightly.nsi:2401 +#: Shared/installer/nightly.nsi:2408 msgid "Online update" msgstr "" #. NETTEST_TITLE2 -#: Shared/installer/nightly.nsi:2402 +#: Shared/installer/nightly.nsi:2409 msgid "Checking for update information" msgstr "" #. NETTEST_STATUS1 -#: Shared/installer/nightly.nsi:2403 +#: Shared/installer/nightly.nsi:2410 msgid "Checking for installer update information..." msgstr "" #. NETTEST_STATUS2 -#: Shared/installer/nightly.nsi:2404 +#: Shared/installer/nightly.nsi:2411 msgid "Please ensure your firewall is not blocking" msgstr "" diff --git a/Shared/installer/nightly.nsi b/Shared/installer/nightly.nsi index d3d7759cdd..7890e37fdc 100644 --- a/Shared/installer/nightly.nsi +++ b/Shared/installer/nightly.nsi @@ -369,6 +369,9 @@ Function .onInstSuccess WriteRegStr HKLM "SOFTWARE\Multi Theft Auto: San Andreas All\Common" "GTA:SA Path" $GTA_DIR WriteRegStr HKLM "SOFTWARE\Multi Theft Auto: San Andreas All\${0.0}" "Last Install Location" $INSTDIR + + # Add 'MaxLoaderThreads' DWORD value for gta_sa.exe to disable multi-threaded loading of DLLs. + WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\gta_sa.exe" "MaxLoaderThreads" 1 # Initilize variables holding paths and names Call MTAInitFileNamesAndPaths @@ -1142,6 +1145,10 @@ Section Uninstall DeleteRegKey HKCR "mtasa" ${EndIf} + # Remove 'MaxLoaderThreads' DWORD value for gta_sa.exe. + DeleteRegValue HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\gta_sa.exe" "MaxLoaderThreads" + DeleteRegKey /ifempty HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\gta_sa.exe" + ${GameExplorer_RemoveGame} ${GUID} ; Delete client shortcuts diff --git a/Shared/mods/deathmatch/logic/CScriptDebugging.cpp b/Shared/mods/deathmatch/logic/CScriptDebugging.cpp index d88b0dce73..701ef435bb 100644 --- a/Shared/mods/deathmatch/logic/CScriptDebugging.cpp +++ b/Shared/mods/deathmatch/logic/CScriptDebugging.cpp @@ -20,6 +20,23 @@ #define MAX_STRING_LENGTH 2048 +enum DebugScriptLevels : std::uint8_t +{ + NONE, + ERRORS_ONLY, + ERRORS_AND_WARNINGS, + ALL, +}; + +enum DebugMessageLevels : std::uint8_t +{ + MESSAGE_TYPE_DEBUG, + MESSAGE_TYPE_ERROR, + MESSAGE_TYPE_WARNING, + MESSAGE_TYPE_INFO, + MESSAGE_TYPE_CUSTOM, +}; + // Handle filename/line number in string void CScriptDebugging::LogPCallError(lua_State* luaVM, const SString& strRes, bool bInitialCall) { @@ -51,6 +68,28 @@ void CScriptDebugging::LogPCallError(lua_State* luaVM, const SString& strRes, bo } } +bool CScriptDebugging::CheckForSufficientDebugLevel(std::uint8_t playerDebugLevel, std::uint8_t messageDebugLevel) const noexcept +{ + bool sufficientDebugLevel = false; + + switch (messageDebugLevel) + { + case MESSAGE_TYPE_ERROR: + sufficientDebugLevel = (playerDebugLevel >= ERRORS_ONLY); + break; + case MESSAGE_TYPE_WARNING: + sufficientDebugLevel = (playerDebugLevel >= ERRORS_AND_WARNINGS); + break; + case MESSAGE_TYPE_INFO: + case MESSAGE_TYPE_CUSTOM: + case MESSAGE_TYPE_DEBUG: + sufficientDebugLevel = (playerDebugLevel == ALL); + break; + } + + return sufficientDebugLevel; +} + void CScriptDebugging::LogCustom(lua_State* luaVM, unsigned char ucRed, unsigned char ucGreen, unsigned char ucBlue, const char* szFormat, ...) { assert(szFormat); diff --git a/Shared/mods/deathmatch/logic/Enums.cpp b/Shared/mods/deathmatch/logic/Enums.cpp index b51348b9e8..1e3d0b2003 100644 --- a/Shared/mods/deathmatch/logic/Enums.cpp +++ b/Shared/mods/deathmatch/logic/Enums.cpp @@ -100,6 +100,7 @@ ADD_ENUM(WorldSpecialProperty::BURNFLIPPEDCARS, "burnflippedcars") ADD_ENUM(WorldSpecialProperty::FIREBALLDESTRUCT, "fireballdestruct") ADD_ENUM(WorldSpecialProperty::EXTENDEDWATERCANNONS, "extendedwatercannons") ADD_ENUM(WorldSpecialProperty::ROADSIGNSTEXT, "roadsignstext") +ADD_ENUM(WorldSpecialProperty::TUNNELWEATHERBLEND, "tunnelweatherblend") IMPLEMENT_ENUM_CLASS_END("world-special-property") IMPLEMENT_ENUM_BEGIN(ePacketID) diff --git a/Shared/mods/deathmatch/logic/Enums.h b/Shared/mods/deathmatch/logic/Enums.h index 9264678962..e975d0d907 100644 --- a/Shared/mods/deathmatch/logic/Enums.h +++ b/Shared/mods/deathmatch/logic/Enums.h @@ -90,6 +90,7 @@ enum class WorldSpecialProperty FIREBALLDESTRUCT, ROADSIGNSTEXT, EXTENDEDWATERCANNONS, + TUNNELWEATHERBLEND, }; DECLARE_ENUM_CLASS(WorldSpecialProperty); diff --git a/Shared/mods/deathmatch/logic/Utils.cpp b/Shared/mods/deathmatch/logic/Utils.cpp index 8ba51be070..db09989cd1 100644 --- a/Shared/mods/deathmatch/logic/Utils.cpp +++ b/Shared/mods/deathmatch/logic/Utils.cpp @@ -92,6 +92,24 @@ bool IsValidFilePath(const char* szDir) return true; } +bool IsValidFilePath(const char* szDir, size_t length) +{ + if (szDir == nullptr) + return false; + + std::uint8_t c, c_d; + + // iterate through the char array + for (size_t i = 0; i < length; i++) + { + c = szDir[i]; // current character + c_d = (i < (length - 1)) ? szDir[i + 1] : 0; // one character ahead, if any + if (!IsVisibleCharacter(c) || c == ':' || (c == '.' && c_d == '.') || (c == '\\' && c_d == '\\')) + return false; + } + return true; +} + void ReplaceOccurrencesInString(std::string& s, const char* a, const char* b) { int idx = 0; @@ -459,6 +477,24 @@ bool IsValidFilePath(const char* szDir) return true; } +bool IsValidFilePath(const char* szDir, size_t length) +{ + if (szDir == nullptr) + return false; + + std::uint8_t c, c_d; + + // iterate through the char array + for (size_t i = 0; i < length; i++) + { + c = szDir[i]; // current character + c_d = (i < (length - 1)) ? szDir[i + 1] : 0; // one character ahead, if any + if (!IsVisibleCharacter(c) || c == ':' || (c == '.' && c_d == '.') || (c == '\\' && c_d == '\\')) + return false; + } + return true; +} + bool IsValidOrganizationPath(const char* szDir) { if (szDir == NULL) diff --git a/Shared/mods/deathmatch/logic/Utils.h b/Shared/mods/deathmatch/logic/Utils.h index 86f30480ef..b42e12f8b4 100644 --- a/Shared/mods/deathmatch/logic/Utils.h +++ b/Shared/mods/deathmatch/logic/Utils.h @@ -136,6 +136,7 @@ double GetRandomDouble(); int GetRandom(int iLow, int iHigh); bool IsValidFilePath(const char* szPath); +bool IsValidFilePath(const char* szDir, size_t length); bool IsValidOrganizationPath(const char* szPath); #endif @@ -277,6 +278,7 @@ unsigned int StripUnwantedCharacters(char* szText, unsigned char cReplace = ' ') unsigned int StripControlCodes(char* szText, unsigned char cReplace = ' '); bool IsControlCode(unsigned char c); bool IsValidFilePath(const char* szDir); +bool IsValidFilePath(const char* szDir, size_t length); void ReplaceOccurrencesInString(std::string& s, const char* a, const char* b); void RaiseFatalError(unsigned int uiCode); diff --git a/Shared/mods/deathmatch/logic/lua/CLuaFunctionParser.h b/Shared/mods/deathmatch/logic/lua/CLuaFunctionParser.h index 8861ef6ef3..3d5f232e7f 100644 --- a/Shared/mods/deathmatch/logic/lua/CLuaFunctionParser.h +++ b/Shared/mods/deathmatch/logic/lua/CLuaFunctionParser.h @@ -19,6 +19,20 @@ class CLuaArgument; #include "lua/LuaBasic.h" #include +class LuaFunctionError +{ +protected: + const char* m_message; + bool m_bWarning; + +public: + constexpr LuaFunctionError(const char* what, bool throwWarning = true) noexcept + : m_message(what), m_bWarning(throwWarning) {} + + constexpr const char* what() const noexcept { return m_message; } + constexpr bool IsWarning() const noexcept { return m_bWarning; } +}; + struct CLuaFunctionParserBase { // iIndex is passed around by reference @@ -33,7 +47,7 @@ struct CLuaFunctionParserBase void TypeToNameVariant(SString& accumulator) { using param = typename is_variant::param1_t; - if (accumulator.length() == 0) + if (accumulator.empty()) accumulator = TypeToName(); else accumulator += "/" + TypeToName(); @@ -45,7 +59,7 @@ struct CLuaFunctionParserBase template SString TypeToName() { - if constexpr (std::is_same_v || std::is_same_v) + if constexpr (std::is_same_v || std::is_same_v || std::is_same_v || std::is_same_v) return "string"; else if constexpr (std::is_same_v) return "boolean"; @@ -90,6 +104,8 @@ struct CLuaFunctionParserBase return ""; else if constexpr (std::is_same_v) return ""; + else + static_assert(sizeof(T) == 0, "Invalid parameter type provided to CLuaFunctionParser!"); } // Reads the parameter type (& value in some cases) at a given index @@ -116,10 +132,8 @@ struct CLuaFunctionParserBase // Avoid printing binary data if (std::find_if(strValue.begin(), strValue.end(), [](char ch) { return !(std::isprint(ch)); }) != strValue.end()) return "string"; - else - { - return SString("string (\"%s\")", strValue.c_str()); - } + + return SString("string (\"%s\")", strValue.c_str()); } case LUA_TBOOLEAN: return SString("boolean (%s)", lua_toboolean(L, index) == 1 ? "true" : "false"); @@ -145,14 +159,13 @@ struct CLuaFunctionParserBase template T Pop(lua_State* L, int& index) { - if (!TypeMatch(L, index)) - { - SString strReceived = ReadParameterAsString(L, index); - SString strExpected = TypeToName(); - SetBadArgumentError(L, strExpected, index, strReceived); - return T{}; - } - return PopUnsafe(L, index); + if (TypeMatch(L, index)) + return PopUnsafe(L, index); + + SString strReceived = ReadParameterAsString(L, index); + SString strExpected = TypeToName(); + SetBadArgumentError(L, strExpected, index, strReceived); + return T{}; } // Special type matcher for variants. Returns -1 if the type does not match @@ -192,56 +205,56 @@ struct CLuaFunctionParserBase // primitive types if constexpr (std::is_same_v || std::is_same_v) return (iArgument == LUA_TSTRING || iArgument == LUA_TNUMBER); - if constexpr (std::is_same_v) + else if constexpr (std::is_same_v) return (iArgument == LUA_TBOOLEAN); - if constexpr (std::is_arithmetic_v) + else if constexpr (std::is_arithmetic_v) return lua_isnumber(L, index); // Advanced types // Enums are represented as strings to Lua - if constexpr (std::is_enum_v) + else if constexpr (std::is_enum_v) return iArgument == LUA_TSTRING; // CLuaArgument can hold any value - if constexpr (std::is_same_v) + else if constexpr (std::is_same_v) return iArgument != LUA_TNONE; // All color classes are read as a single tocolor number // Do not be tempted to change this to is_base_of // SColorARGB etc are only **constructors** for SColor! - if constexpr (std::is_same_v) + else if constexpr (std::is_same_v) return lua_isnumber(L, index); // std::optional is used for optional parameters // which may also be in the middle of a parameter list // therefore it is always valid to attempt to read an // optional - if constexpr (is_specialization::value) + else if constexpr (is_specialization::value) return true; // std::vector is used for arrays built from tables - if constexpr (is_2specialization::value) + else if constexpr (is_2specialization::value) return iArgument == LUA_TTABLE; // std::unordered_map is used for maps built from tables - if constexpr (is_5specialization::value) + else if constexpr (is_5specialization::value) return iArgument == LUA_TTABLE; // CLuaFunctionRef is used for functions - if constexpr (std::is_same_v) + else if constexpr (std::is_same_v) return iArgument == LUA_TFUNCTION; // lua_State* can be taken as first argument of any function - if constexpr (std::is_same_v) + else if constexpr (std::is_same_v) return index == 1; // variants can be used by any of the underlying types // thus recursively use this function - if constexpr (is_variant::value) + else if constexpr (is_variant::value) return TypeMatchVariant(L, index) != -1; // Vector2 may either be represented by CLuaVector or by two numbers - if constexpr (std::is_same_v) + else if constexpr (std::is_same_v) { if (lua_isnumber(L, index) && lua_isnumber(L, index + 1)) return true; @@ -249,7 +262,7 @@ struct CLuaFunctionParserBase } // Vector3 may either be represented by CLuaVector or by three numbers - if constexpr (std::is_same_v) + else if constexpr (std::is_same_v) { if (lua_isnumber(L, index) && lua_isnumber(L, index + 1) && lua_isnumber(L, index + 2)) return true; @@ -257,14 +270,14 @@ struct CLuaFunctionParserBase } // Vector4 may either be represented by CLuaVector or by three numbers - if constexpr (std::is_same_v) + else if constexpr (std::is_same_v) { if (lua_isnumber(L, index) && lua_isnumber(L, index + 1) && lua_isnumber(L, index + 2) && lua_isnumber(L, index + 3)) return true; return iArgument == LUA_TUSERDATA || iArgument == LUA_TLIGHTUSERDATA; } // CMatrix may either be represented by 3 CLuaVector or by 12 numbers - if constexpr (std::is_same_v) + else if constexpr (std::is_same_v) { for (int i = 0; i < sizeof(CMatrix) / sizeof(float); i++) { @@ -275,16 +288,16 @@ struct CLuaFunctionParserBase } // Catch all for class pointer types, assume all classes are valid script entities // and can be fetched from a userdata - if constexpr (std::is_pointer_v && std::is_class_v>) + else if constexpr (std::is_pointer_v && std::is_class_v>) return iArgument == LUA_TUSERDATA || iArgument == LUA_TLIGHTUSERDATA; // dummy type is used as overload extension if one overload has fewer arguments // thus it is only allowed if there are no further args on the Lua side - if constexpr (std::is_same_v) + else if constexpr (std::is_same_v) return iArgument == LUA_TNONE; // no value - if constexpr (std::is_same_v) + else if constexpr (std::is_same_v) return iArgument == LUA_TNONE; } @@ -356,11 +369,12 @@ struct CLuaFunctionParserBase return lua::PopPrimitive(L, index); else if constexpr (std::is_same_v) return lua::PopPrimitive(L, index); - else if constexpr (std::is_integral_v || std::is_floating_point_v) // bool is an integral type, so must pop it before ^^ + else if constexpr (std::is_integral_v || std::is_floating_point_v) // bool is an integral type, so must pop it before ^^ { const auto number = lua::PopPrimitive(L, index); - const auto SetError = [&](const char* expected, const char* got) { + const auto SetError = [&](const char* expected, const char* got) + { // Subtract one from the index, as the call to lua::PopPrimitive above increments the index, even if the // underlying element is of a wrong type SetBadArgumentError(L, expected, index - 1, got); @@ -372,7 +386,8 @@ struct CLuaFunctionParserBase return static_cast(number); } - if (std::isinf(number)) { + if (std::isinf(number)) + { SetError("number", "inf"); return static_cast(number); } @@ -381,7 +396,8 @@ struct CLuaFunctionParserBase // For now this doesn't do all the safety checks, but this should be "good enough" [until we switch to C++20] if constexpr (std::is_integral_v && std::is_unsigned_v) { - if (number < 0) { + if (number < 0) + { SetError("positive number", "negative"); return static_cast(number); } @@ -396,15 +412,13 @@ struct CLuaFunctionParserBase T eValue; if (StringToEnum(strValue, eValue)) return eValue; - else - { - // Subtract one from the index, as the call to lua::PopPrimitive above increments the index, even if the - // underlying element is of a wrong type - SString strReceived = ReadParameterAsString(L, index - 1); - SString strExpected = GetEnumTypeName((T)0); - SetBadArgumentError(L, strExpected, index - 1, strReceived); - return static_cast(0); - } + + // Subtract one from the index, as the call to lua::PopPrimitive above increments the index, even if the + // underlying element is of a wrong type + SString strReceived = ReadParameterAsString(L, index - 1); + SString strExpected = GetEnumTypeName((T)0); + SetBadArgumentError(L, strExpected, index - 1, strReceived); + return static_cast(0); } else if constexpr (is_specialization::value) { @@ -462,7 +476,7 @@ struct CLuaFunctionParserBase continue; } - int i = -2; + int i = -2; // When key_t is a string and the actual type of a key is number Lua will conduct an implicit value change // that can confuse lua_next and lead to a crash. To fix it we can copy a key in order to save an original key @@ -470,7 +484,7 @@ struct CLuaFunctionParserBase lua_pushvalue(L, i); auto v = PopUnsafe(L, i); - auto k = PopUnsafe(L, i); + auto k = PopUnsafe(L, i); map.emplace(std::move(k), std::move(v)); lua_pop(L, 2); // drop values(key copy and value), keep original key for lua_next } @@ -481,27 +495,26 @@ struct CLuaFunctionParserBase { CLuaMain& luaMain = lua_getownercluamain(L); const void* pFuncPtr = lua_topointer(L, index); + CRefInfo* pInfo = MapFind(luaMain.m_CallbackTable, pFuncPtr); - if (CRefInfo* pInfo = MapFind(luaMain.m_CallbackTable, pFuncPtr)) + if (pInfo) { // Re-use the lua ref we already have to this function pInfo->ulUseCount++; ++index; return CLuaFunctionRef(L, pInfo->iFunction, pFuncPtr); } - else - { - // Get a lua ref to this function - lua_pushvalue(L, index); - int ref = luaL_ref(L, LUA_REGISTRYINDEX); - // Save ref info - CRefInfo info{1, ref}; - MapSet(luaMain.m_CallbackTable, pFuncPtr, info); + // Get a lua ref to this function + lua_pushvalue(L, index); + int ref = luaL_ref(L, LUA_REGISTRYINDEX); - ++index; - return CLuaFunctionRef(L, ref, pFuncPtr); - } + // Save ref info + CRefInfo info{1, ref}; + MapSet(luaMain.m_CallbackTable, pFuncPtr, info); + + ++index; + return CLuaFunctionRef(L, ref, pFuncPtr); } else if constexpr (std::is_same_v) return L; @@ -516,93 +529,78 @@ struct CLuaFunctionParserBase else if constexpr (std::is_same_v) { if (lua_isnumber(L, index)) - { - return { PopUnsafe(L, index), PopUnsafe(L, index) }; - } - else - { - int iType = lua_type(L, index); - bool isLightUserData = iType == LUA_TLIGHTUSERDATA; - void* pValue = lua::PopPrimitive(L, index); - auto cast = [isLightUserData, pValue, L](auto null) { - return isLightUserData ? UserDataCast(reinterpret_cast(pValue), L) - : UserDataCast(*reinterpret_cast(pValue), L); - }; - // A vector2 may also be filled from a vector3/vector4 - if (CLuaVector2D* pVec2D = cast((CLuaVector2D*)0); pVec2D != nullptr) - return *pVec2D; - if (CLuaVector3D* pVec3D = cast((CLuaVector3D*)0); pVec3D != nullptr) - return *pVec3D; - if (CLuaVector4D* pVec4D = cast((CLuaVector4D*)0); pVec4D != nullptr) - return *pVec4D; + return {PopUnsafe(L, index), PopUnsafe(L, index)}; - // Subtract one from the index, as the call to lua::PopPrimitive above increments the index, even if the - // underlying element is of a wrong type - SetBadArgumentError(L, "vector2", index - 1, pValue, isLightUserData); - return T{}; - } + int iType = lua_type(L, index); + bool isLightUserData = iType == LUA_TLIGHTUSERDATA; + void* pValue = lua::PopPrimitive(L, index); + auto cast = [isLightUserData, pValue, L](auto null) { + return isLightUserData ? UserDataCast(reinterpret_cast(pValue), L) + : UserDataCast(*reinterpret_cast(pValue), L); + }; + // A vector2 may also be filled from a vector3/vector4 + if (CLuaVector2D* pVec2D = cast((CLuaVector2D*)0); pVec2D != nullptr) + return *pVec2D; + if (CLuaVector3D* pVec3D = cast((CLuaVector3D*)0); pVec3D != nullptr) + return *pVec3D; + if (CLuaVector4D* pVec4D = cast((CLuaVector4D*)0); pVec4D != nullptr) + return *pVec4D; + + // Subtract one from the index, as the call to lua::PopPrimitive above increments the index, even if the + // underlying element is of a wrong type + SetBadArgumentError(L, "vector2", index - 1, pValue, isLightUserData); + return T{}; } else if constexpr (std::is_same_v) { if (lua_isnumber(L, index)) - { - return { PopUnsafe(L, index), PopUnsafe(L, index), PopUnsafe(L, index) }; - } - else - { - int iType = lua_type(L, index); - bool isLightUserData = iType == LUA_TLIGHTUSERDATA; - void* pValue = lua::PopPrimitive(L, index); - auto cast = [isLightUserData, pValue, L](auto null) { - return isLightUserData ? UserDataCast(reinterpret_cast(pValue), L) - : UserDataCast(*reinterpret_cast(pValue), L); - }; - // A vector3 may also be filled from a vector4 - if (CLuaVector3D* pVec3D = cast((CLuaVector3D*)0); pVec3D != nullptr) - return *pVec3D; - if (CLuaVector4D* pVec4D = cast((CLuaVector4D*)0); pVec4D != nullptr) - return *pVec4D; + return {PopUnsafe(L, index), PopUnsafe(L, index), PopUnsafe(L, index)}; - // Subtract one from the index, as the call to lua::PopPrimitive above increments the index, even if the - // underlying element is of a wrong type - SetBadArgumentError(L, "vector3", index - 1, pValue, isLightUserData); - return T{}; - } + int iType = lua_type(L, index); + bool isLightUserData = iType == LUA_TLIGHTUSERDATA; + void* pValue = lua::PopPrimitive(L, index); + auto cast = [isLightUserData, pValue, L](auto null) { + return isLightUserData ? UserDataCast(reinterpret_cast(pValue), L) + : UserDataCast(*reinterpret_cast(pValue), L); + }; + // A vector3 may also be filled from a vector4 + if (CLuaVector3D* pVec3D = cast((CLuaVector3D*)0); pVec3D != nullptr) + return *pVec3D; + if (CLuaVector4D* pVec4D = cast((CLuaVector4D*)0); pVec4D != nullptr) + return *pVec4D; + + // Subtract one from the index, as the call to lua::PopPrimitive above increments the index, even if the + // underlying element is of a wrong type + SetBadArgumentError(L, "vector3", index - 1, pValue, isLightUserData); + return T{}; } else if constexpr (std::is_same_v) { if (lua_isnumber(L, index)) - { - return { PopUnsafe(L, index), PopUnsafe(L, index), - PopUnsafe(L, index), PopUnsafe(L, index) }; - } - else - { - int iType = lua_type(L, index); - bool isLightUserData = iType == LUA_TLIGHTUSERDATA; - void* pValue = lua::PopPrimitive(L, index); - auto cast = [isLightUserData, pValue, L](auto null) { - return isLightUserData ? UserDataCast(reinterpret_cast(pValue), L) - : UserDataCast(*reinterpret_cast(pValue), L); - }; - // A vector3 may also be filled from a vector4 - if (CLuaVector4D* pVec4D = cast((CLuaVector4D*)0); pVec4D != nullptr) - return *pVec4D; + return {PopUnsafe(L, index), PopUnsafe(L, index), PopUnsafe(L, index), PopUnsafe(L, index)}; - // Subtract one from the index, as the call to lua::PopPrimitive above increments the index, even if the - // underlying element is of a wrong type - SetBadArgumentError(L, "vector4", index - 1, pValue, isLightUserData); - return T{}; - } + int iType = lua_type(L, index); + bool isLightUserData = iType == LUA_TLIGHTUSERDATA; + void* pValue = lua::PopPrimitive(L, index); + auto cast = [isLightUserData, pValue, L](auto null) { + return isLightUserData ? UserDataCast(reinterpret_cast(pValue), L) + : UserDataCast(*reinterpret_cast(pValue), L); + }; + // A vector3 may also be filled from a vector4 + if (CLuaVector4D* pVec4D = cast((CLuaVector4D*)0); pVec4D != nullptr) + return *pVec4D; + + // Subtract one from the index, as the call to lua::PopPrimitive above increments the index, even if the + // underlying element is of a wrong type + SetBadArgumentError(L, "vector4", index - 1, pValue, isLightUserData); + return T{}; } else if constexpr (std::is_same_v) { if (lua_isnumber(L, index)) { - const auto ReadVector = [&] { - return CVector(PopUnsafe(L, index), PopUnsafe(L, index), PopUnsafe(L, index)); - }; - + const auto ReadVector = [&] { return CVector(PopUnsafe(L, index), PopUnsafe(L, index), PopUnsafe(L, index)); }; + CMatrix matrix; matrix.vRight = ReadVector(); @@ -612,24 +610,22 @@ struct CLuaFunctionParserBase return matrix; } - else - { - int iType = lua_type(L, index); - bool isLightUserData = iType == LUA_TLIGHTUSERDATA; - void* pValue = lua::PopPrimitive(L, index); - auto cast = [isLightUserData, pValue, L](auto null) { - return isLightUserData ? UserDataCast(reinterpret_cast(pValue), L) - : UserDataCast(*reinterpret_cast(pValue), L); - }; - // A vector4 may also be filled from a CLuaMatrix - if (CLuaMatrix* pMatrix = cast((CLuaMatrix*)0); pMatrix != nullptr) - return *pMatrix; - // Subtract one from the index, as the call to lua::PopPrimitive above increments the index, even if the - // underlying element is of a wrong type - SetBadArgumentError(L, "matrix", index - 1, pValue, isLightUserData); - return T{}; - } + int iType = lua_type(L, index); + bool isLightUserData = iType == LUA_TLIGHTUSERDATA; + void* pValue = lua::PopPrimitive(L, index); + auto cast = [isLightUserData, pValue, L](auto null) { + return isLightUserData ? UserDataCast(reinterpret_cast(pValue), L) + : UserDataCast(*reinterpret_cast(pValue), L); + }; + // A vector4 may also be filled from a CLuaMatrix + if (CLuaMatrix* pMatrix = cast((CLuaMatrix*)0); pMatrix != nullptr) + return *pMatrix; + + // Subtract one from the index, as the call to lua::PopPrimitive above increments the index, even if the + // underlying element is of a wrong type + SetBadArgumentError(L, "matrix", index - 1, pValue, isLightUserData); + return T{}; } // Catch all for class pointer types, assume all classes are valid script entities // and can be fetched from a userdata @@ -639,14 +635,13 @@ struct CLuaFunctionParserBase void* pValue = lua::PopPrimitive(L, index); using class_t = std::remove_pointer_t; auto result = isLightUserData ? UserDataCast((class_t*)pValue, L) : UserDataCast(*reinterpret_cast(pValue), L); - if (result == nullptr) - { - // Subtract one from the index, as the call to lua::PopPrimitive above increments the index, even if the - // underlying element is of a wrong type - SetBadArgumentError(L, index - 1, pValue, isLightUserData); - return nullptr; - } - return static_cast(result); + if (result) + return static_cast(result); + + // Subtract one from the index, as the call to lua::PopPrimitive above increments the index, even if the + // underlying element is of a wrong type + SetBadArgumentError(L, index - 1, pValue, isLightUserData); + return nullptr; } else if constexpr (std::is_same_v) return static_cast(static_cast(lua::PopPrimitive(L, index))); @@ -674,10 +669,9 @@ struct CLuaFunctionParser : CLuaFunctionP template auto Call(lua_State* L, Params&&... ps) { - if (strError.length() != 0) - { + if (!strError.empty()) return -1; - } + if constexpr (sizeof...(Params) == sizeof...(Args)) { if constexpr (std::is_same_v) @@ -722,7 +716,8 @@ struct CLuaFunctionParser : CLuaFunctionP int operator()(lua_State* L, CScriptDebugging* pScriptDebugging) { - int iResult = 0; + int iResult = 0; + bool bIsWarning = false; try { iResult = Call(L); @@ -733,20 +728,23 @@ struct CLuaFunctionParser : CLuaFunctionP // as an additional way to provide further argument errors strError = e.what(); } - if (strError.length() != 0) + catch (LuaFunctionError& e) { - if constexpr (ErrorOnFailure) - { - luaL_error(L, strError.c_str()); - } - else - { - pScriptDebugging->LogCustom(L, strError.c_str()); - lua::Push(L, ReturnOnFailure); - } + strError = e.what(); + bIsWarning = e.IsWarning(); + } + if (strError.empty()) + return iResult; + + if (ErrorOnFailure && !bIsWarning) + { + luaL_error(L, strError.c_str()); return 1; } - return iResult; + + pScriptDebugging->LogCustom(L, strError.c_str()); + lua::Push(L, ReturnOnFailure); + return 1; } }; @@ -757,10 +755,7 @@ template { // Remove constness here, because we must be able to std::move - static R Call(T* o, std::remove_const_t... args) - { - return (o->*F)(std::move(args)...); - } + static R Call(T* o, std::remove_const_t... args) { return (o->*F)(std::move(args)...); } auto operator()(lua_State* L, CScriptDebugging* pScriptDebugging) { diff --git a/Shared/sdk/net/SyncStructures.h b/Shared/sdk/net/SyncStructures.h index 636f90d8eb..1e9b8215b3 100644 --- a/Shared/sdk/net/SyncStructures.h +++ b/Shared/sdk/net/SyncStructures.h @@ -2040,6 +2040,10 @@ struct SWorldSpecialPropertiesStateSync : public ISyncStructure { BITCOUNT4 = 1 }; + enum + { + BITCOUNT5 = 1 + }; bool Read(NetBitStreamInterface& bitStream) { @@ -2059,6 +2063,11 @@ struct SWorldSpecialPropertiesStateSync : public ISyncStructure else data4.extendedwatercannons = true; + if (bitStream.Can(eBitStreamVersion::WorldSpecialProperty_TunnelWeatherBlend)) + isOK &= bitStream.ReadBits(reinterpret_cast(&data5), BITCOUNT5); + else + data5.tunnelweatherblend = true; + //// Example for adding item: // if (bitStream.Can(eBitStreamVersion::YourProperty)) // isOK &= bitStream.ReadBits(reinterpret_cast(&data9), BITCOUNT9); @@ -2079,6 +2088,9 @@ struct SWorldSpecialPropertiesStateSync : public ISyncStructure if (bitStream.Can(eBitStreamVersion::WorldSpecialProperty_ExtendedWaterCannons)) bitStream.WriteBits(reinterpret_cast(&data4), BITCOUNT4); + if (bitStream.Can(eBitStreamVersion::WorldSpecialProperty_TunnelWeatherBlend)) + bitStream.WriteBits(reinterpret_cast(&data5), BITCOUNT5); + //// Example for adding item: // if (bitStream.Can(eBitStreamVersion::YourProperty)) // bitStream.WriteBits(reinterpret_cast(&data9), BITCOUNT9); @@ -2116,6 +2128,11 @@ struct SWorldSpecialPropertiesStateSync : public ISyncStructure bool extendedwatercannons : 1; } data4; + struct + { + bool tunnelweatherblend : 1; + } data5; + SWorldSpecialPropertiesStateSync() { // Set default states @@ -2134,6 +2151,7 @@ struct SWorldSpecialPropertiesStateSync : public ISyncStructure data2.fireballdestruct = true; data3.roadsignstext = true; data4.extendedwatercannons = true; + data5.tunnelweatherblend = true; } }; diff --git a/Shared/sdk/net/bitstream.h b/Shared/sdk/net/bitstream.h index 9c32320d53..e4dc40adf2 100644 --- a/Shared/sdk/net/bitstream.h +++ b/Shared/sdk/net/bitstream.h @@ -556,6 +556,18 @@ enum class eBitStreamVersion : unsigned short // 2024-06-16 PedSync_Revision, + // Add "extendedwatercannons" to setWorldSpecialPropertyEnabled + // 2024-06-30 + WorldSpecialProperty_TunnelWeatherBlend, + + // Checkpoint & arrow alpha fix + // 2024-07-03 + Marker_IgnoreAlphaLimits, + + // Add "setMarkerTargetArrowProperties" + // 2024-07-05 + SetMarkerTargetArrowProperties, + // This allows us to automatically increment the BitStreamVersion when things are added to this enum. // Make sure you only add things above this comment. Next, diff --git a/Shared/sdk/net/rpc_enums.h b/Shared/sdk/net/rpc_enums.h index 9441714939..e4ce53df29 100644 --- a/Shared/sdk/net/rpc_enums.h +++ b/Shared/sdk/net/rpc_enums.h @@ -279,5 +279,9 @@ enum eElementRPCFunctions BREAK_OBJECT, + SET_PLAYER_SCRIPT_DEBUG_LEVEL, + + SET_MARKER_TARGET_ARROW_PROPERTIES, + NUM_RPC_FUNCS // Add above this line }; diff --git a/utils/7z/7za.dll b/utils/7z/7za.dll index 95fcf2d1eb..5367da6fca 100644 Binary files a/utils/7z/7za.dll and b/utils/7z/7za.dll differ diff --git a/utils/7z/7za.exe b/utils/7z/7za.exe index 2a943e6017..bb7216dd84 100644 Binary files a/utils/7z/7za.exe and b/utils/7z/7za.exe differ diff --git a/utils/7z/7zxa.dll b/utils/7z/7zxa.dll index c1ced38926..ccb3e98251 100644 Binary files a/utils/7z/7zxa.dll and b/utils/7z/7zxa.dll differ diff --git a/utils/buildactions/install_cef.lua b/utils/buildactions/install_cef.lua index 906de66a89..53c9fe8c77 100644 --- a/utils/buildactions/install_cef.lua +++ b/utils/buildactions/install_cef.lua @@ -9,8 +9,8 @@ local CEF_URL_PREFIX = "https://cef-builds.spotifycdn.com/cef_binary_" local CEF_URL_SUFFIX = "_windows32_minimal.tar.bz2" -- Change here to update CEF version -local CEF_VERSION = "126.2.6+gc7c4ac9+chromium-126.0.6478.115" -local CEF_HASH = "e8392f2abc7d392a104fcb10bbd35ca7ddc1353ce5957c92bddcef3acd91f09c" +local CEF_VERSION = "126.2.9+g169fea9+chromium-126.0.6478.127" +local CEF_HASH = "de207b5f07e03a4242e091e7a5389b4027385c53c8e826f2e5798f4391f04b9e" function make_cef_download_url() return CEF_URL_PREFIX..http.escapeUrlParam(CEF_VERSION)..CEF_URL_SUFFIX diff --git a/vendor/cryptopp/nbtheory.cpp b/vendor/cryptopp/nbtheory.cpp index 67f63a64be..d4b8cfa507 100644 --- a/vendor/cryptopp/nbtheory.cpp +++ b/vendor/cryptopp/nbtheory.cpp @@ -525,9 +525,6 @@ Integer MaurerProvablePrime(RandomNumberGenerator &rng, unsigned int bits) Integer CRT(const Integer &xp, const Integer &p, const Integer &xq, const Integer &q, const Integer &u) { - // Callers must ensure p and q are prime, GH #1249 - CRYPTOPP_ASSERT(IsPrime(p) && IsPrime(q)); - // isn't operator overloading great? return p * (u * (xq-xp) % q) + xp; /* diff --git a/vendor/freetype/README b/vendor/freetype/README index cd4c1d7d11..19c934256f 100644 --- a/vendor/freetype/README +++ b/vendor/freetype/README @@ -94,7 +94,7 @@ Enjoy! ---------------------------------------------------------------------- -Copyright (C) 2006-2023 by +Copyright (C) 2006-2024 by David Turner, Robert Wilhelm, and Werner Lemberg. This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/builds/windows/ftdebug.c b/vendor/freetype/builds/windows/ftdebug.c index 360f8c7e32..2c69967638 100644 --- a/vendor/freetype/builds/windows/ftdebug.c +++ b/vendor/freetype/builds/windows/ftdebug.c @@ -4,7 +4,7 @@ * * Debugging and logging component for Win32 (body). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/builds/windows/ftsystem.c b/vendor/freetype/builds/windows/ftsystem.c index 418d7995e3..477cad71f7 100644 --- a/vendor/freetype/builds/windows/ftsystem.c +++ b/vendor/freetype/builds/windows/ftsystem.c @@ -4,7 +4,7 @@ * * Windows-specific FreeType low-level system interface (body). * - * Copyright (C) 2021-2023 by + * Copyright (C) 2021-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -196,8 +196,8 @@ } - /* non-desktop Universal Windows Platform */ -#if defined( WINAPI_FAMILY ) && WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP + /* support for Universal Windows Platform UWP, formerly WinRT */ +#ifdef _WINRT_DLL #define PACK_DWORD64( hi, lo ) ( ( (DWORD64)(hi) << 32 ) | (DWORD)(lo) ) @@ -248,10 +248,11 @@ dwCreationDisposition, &createExParams ); } -#endif +#endif /* _WINRT_DLL */ -#if defined( _WIN32_WCE ) + /* support for Windows CE */ +#ifdef _WIN32_WCE /* malloc.h provides implementation of alloca()/_alloca() */ #include @@ -291,9 +292,9 @@ dwFlagsAndAttributes, hTemplateFile ); } -#endif - +#endif /* _WIN32_WCE */ + /* support for really old Windows */ #if defined( _WIN32_WCE ) || defined ( _WIN32_WINDOWS ) || \ !defined( _WIN32_WINNT ) || _WIN32_WINNT <= 0x0400 @@ -311,7 +312,7 @@ return TRUE; } -#endif +#endif /* _WIN32_WCE || _WIN32_WINDOWS || _WIN32_WINNT <= 0x0400 */ /* documentation is in ftobjs.h */ diff --git a/vendor/freetype/include/dlg/dlg.h b/vendor/freetype/include/dlg/dlg.h deleted file mode 100644 index fa10730e83..0000000000 --- a/vendor/freetype/include/dlg/dlg.h +++ /dev/null @@ -1,290 +0,0 @@ -// Copyright (c) 2019 nyorain -// Distributed under the Boost Software License, Version 1.0. -// See accompanying file LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt - -#ifndef INC_DLG_DLG_H_ -#define INC_DLG_DLG_H_ - -#include -#include -#include -#include -#include - -// Hosted at https://github.com/nyorain/dlg. -// There are examples and documentation. -// Issue reports and contributions appreciated. - -// - CONFIG - -// Define this macro to make all dlg macros have no effect at all -// #define DLG_DISABLE - -// the log/assertion levels below which logs/assertions are ignored -// defaulted depending on the NDEBUG macro -#ifndef DLG_LOG_LEVEL - #ifdef NDEBUG - #define DLG_LOG_LEVEL dlg_level_warn - #else - #define DLG_LOG_LEVEL dlg_level_trace - #endif -#endif - -#ifndef DLG_ASSERT_LEVEL - #ifdef NDEBUG - #define DLG_ASSERT_LEVEL dlg_level_warn - #else - #define DLG_ASSERT_LEVEL dlg_level_trace - #endif -#endif - -// the assert level of dlg_assert -#ifndef DLG_DEFAULT_ASSERT - #define DLG_DEFAULT_ASSERT dlg_level_error -#endif - -// evaluated to the 'file' member in dlg_origin -#ifndef DLG_FILE - #define DLG_FILE dlg__strip_root_path(__FILE__, DLG_BASE_PATH) - - // the base path stripped from __FILE__. If you don't override DLG_FILE set this to - // the project root to make 'main.c' from '/some/bullshit/main.c' - #ifndef DLG_BASE_PATH - #define DLG_BASE_PATH "" - #endif -#endif - -// Default tags applied to all logs/assertions (in the defining file). -// Must be in format ```#define DLG_DEFAULT_TAGS "tag1", "tag2"``` -// or just nothing (as defaulted here) -#ifndef DLG_DEFAULT_TAGS - #define DLG_DEFAULT_TAGS_TERM NULL -#else - #define DLG_DEFAULT_TAGS_TERM DLG_DEFAULT_TAGS, NULL -#endif - -// The function used for formatting. Can have any signature, but must be callable with -// the arguments the log/assertions macros are called with. Must return a const char* -// that will not be freed by dlg, the formatting function must keep track of it. -// The formatting function might use dlg_thread_buffer or a custom owned buffer. -// The returned const char* has to be valid until the dlg log/assertion ends. -// Usually a c function with ... (i.e. using va_list) or a variadic c++ template do -// allow formatting. -#ifndef DLG_FMT_FUNC - #define DLG_FMT_FUNC dlg__printf_format -#endif - -// Only overwrite (i.e. predefine) this if you know what you are doing. -// On windows this is used to add the dllimport specified. -// If you are using the static version of dlg (on windows) define -// DLG_STATIC before including dlg.h -#ifndef DLG_API - #if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(DLG_STATIC) - #define DLG_API __declspec(dllimport) - #else - #define DLG_API - #endif -#endif - -// This macro is used when an assertion fails. It gets the source expression -// and can return an alternative (that must stay alive). -// Mainly useful to execute something on failed assertion. -#ifndef DLG_FAILED_ASSERTION_TEXT - #define DLG_FAILED_ASSERTION_TEXT(x) x -#endif - -// - utility - -// two methods needed since cplusplus does not support compound literals -// and c does not support uniform initialization/initializer lists -#ifdef __cplusplus - #include - #define DLG_CREATE_TAGS(...) std::initializer_list \ - {DLG_DEFAULT_TAGS_TERM, __VA_ARGS__, NULL}.begin() -#else - #define DLG_CREATE_TAGS(...) (const char* const[]) {DLG_DEFAULT_TAGS_TERM, __VA_ARGS__, NULL} -#endif - -#ifdef __GNUC__ - #define DLG_PRINTF_ATTRIB(a, b) __attribute__ ((format (printf, a, b))) -#else - #define DLG_PRINTF_ATTRIB(a, b) -#endif - -#ifdef __cplusplus -extern "C" { -#endif - - -// Represents the importance of a log/assertion call. -enum dlg_level { - dlg_level_trace = 0, // temporary used debug, e.g. to check if control reaches function - dlg_level_debug, // general debugging, prints e.g. all major events - dlg_level_info, // general useful information - dlg_level_warn, // warning, something went wrong but might have no (really bad) side effect - dlg_level_error, // something really went wrong; expect serious issues - dlg_level_fatal // critical error; application is likely to crash/exit -}; - -// Holds various information associated with a log/assertion call. -// Forwarded to the output handler. -struct dlg_origin { - const char* file; - unsigned int line; - const char* func; - enum dlg_level level; - const char** tags; // null-terminated - const char* expr; // assertion expression, otherwise null -}; - -// Type of the output handler, see dlg_set_handler. -typedef void(*dlg_handler)(const struct dlg_origin* origin, const char* string, void* data); - -#ifndef DLG_DISABLE - // Tagged/Untagged logging with variable level - // Tags must always be in the format `("tag1", "tag2")` (including brackets) - // Example usages: - // dlg_log(dlg_level_warning, "test 1") - // dlg_logt(("tag1, "tag2"), dlg_level_debug, "test %d", 2) - #define dlg_log(level, ...) if(level >= DLG_LOG_LEVEL) \ - dlg__do_log(level, DLG_CREATE_TAGS(NULL), DLG_FILE, __LINE__, __func__, \ - DLG_FMT_FUNC(__VA_ARGS__), NULL) - #define dlg_logt(level, tags, ...) if(level >= DLG_LOG_LEVEL) \ - dlg__do_log(level, DLG_CREATE_TAGS tags, DLG_FILE, __LINE__, __func__, \ - DLG_FMT_FUNC(__VA_ARGS__), NULL) - - // Dynamic level assert macros in various versions for additional arguments - // Example usages: - // dlg_assertl(dlg_level_warning, data != nullptr); - // dlg_assertlt(("tag1, "tag2"), dlg_level_trace, data != nullptr); - // dlg_asserttlm(("tag1), dlg_level_warning, data != nullptr, "Data must not be null"); - // dlg_assertlm(dlg_level_error, data != nullptr, "Data must not be null"); - #define dlg_assertl(level, expr) if(level >= DLG_ASSERT_LEVEL && !(expr)) \ - dlg__do_log(level, DLG_CREATE_TAGS(NULL), DLG_FILE, __LINE__, __func__, NULL, \ - DLG_FAILED_ASSERTION_TEXT(#expr)) - #define dlg_assertlt(level, tags, expr) if(level >= DLG_ASSERT_LEVEL && !(expr)) \ - dlg__do_log(level, DLG_CREATE_TAGS tags, DLG_FILE, __LINE__, __func__, NULL, \ - DLG_FAILED_ASSERTION_TEXT(#expr)) - #define dlg_assertlm(level, expr, ...) if(level >= DLG_ASSERT_LEVEL && !(expr)) \ - dlg__do_log(level, DLG_CREATE_TAGS(NULL), DLG_FILE, __LINE__, __func__, \ - DLG_FMT_FUNC(__VA_ARGS__), DLG_FAILED_ASSERTION_TEXT(#expr)) - #define dlg_assertltm(level, tags, expr, ...) if(level >= DLG_ASSERT_LEVEL && !(expr)) \ - dlg__do_log(level, DLG_CREATE_TAGS tags, DLG_FILE, __LINE__, \ - __func__, DLG_FMT_FUNC(__VA_ARGS__), DLG_FAILED_ASSERTION_TEXT(#expr)) - - #define dlg__assert_or(level, tags, expr, code, msg) if(!(expr)) {\ - if(level >= DLG_ASSERT_LEVEL) \ - dlg__do_log(level, tags, DLG_FILE, __LINE__, __func__, msg, \ - DLG_FAILED_ASSERTION_TEXT(#expr)); \ - code; \ - } (void) NULL - - // - Private interface: not part of the abi/api but needed in macros - - // Formats the given format string and arguments as printf would, uses the thread buffer. - DLG_API const char* dlg__printf_format(const char* format, ...) DLG_PRINTF_ATTRIB(1, 2); - DLG_API void dlg__do_log(enum dlg_level lvl, const char* const*, const char*, int, - const char*, const char*, const char*); - DLG_API const char* dlg__strip_root_path(const char* file, const char* base); - -#else // DLG_DISABLE - - #define dlg_log(level, ...) - #define dlg_logt(level, tags, ...) - - #define dlg_assertl(level, expr) // assert without tags/message - #define dlg_assertlt(level, tags, expr) // assert with tags - #define dlg_assertlm(level, expr, ...) // assert with message - #define dlg_assertltm(level, tags, expr, ...) // assert with tags & message - - #define dlg__assert_or(level, tags, expr, code, msg) if(!(expr)) { code; } (void) NULL -#endif // DLG_DISABLE - -// The API below is independent from DLG_DISABLE - -// Sets the handler that is responsible for formatting and outputting log calls. -// This function is not thread safe and the handler is set globally. -// The handler itself must not change dlg tags or call a dlg macro (if it -// does so, the provided string or tags array in 'origin' might get invalid). -// The handler can also be used for various other things such as dealing -// with failed assertions or filtering calls based on the passed tags. -// The default handler is dlg_default_output (see its doc for more info). -// If using c++ make sure the registered handler cannot throw e.g. by -// wrapping everything into a try-catch blog. -DLG_API void dlg_set_handler(dlg_handler handler, void* data); - -// The default output handler. -// Only use this to reset the output handler, prefer to use -// dlg_generic_output (from output.h) which this function simply calls. -// It also flushes the stream used and correctly outputs even from multiple threads. -DLG_API void dlg_default_output(const struct dlg_origin*, const char* string, void*); - -// Returns the currently active dlg handler and sets `data` to -// its user data pointer. `data` must not be NULL. -// Useful to create handler chains. -// This function is not threadsafe, i.e. retrieving the handler while -// changing it from another thread is unsafe. -// See `dlg_set_handler`. -DLG_API dlg_handler dlg_get_handler(void** data); - -// Adds the given tag associated with the given function to the thread specific list. -// If func is not NULL the tag will only applied to calls from the same function. -// Remove the tag again calling dlg_remove_tag (with exactly the same pointers!). -// Does not check if the tag is already present. -DLG_API void dlg_add_tag(const char* tag, const char* func); - -// Removes a tag added with dlg_add_tag (has no effect for tags no present). -// The pointers must be exactly the same pointers that were supplied to dlg_add_tag, -// this function will not check using strcmp. When the same tag/func combination -// is added multiple times, this function remove exactly one candidate, it is -// undefined which. Returns whether a tag was found (and removed). -DLG_API bool dlg_remove_tag(const char* tag, const char* func); - -// Returns the thread-specific buffer and its size for dlg. -// The buffer should only be used by formatting functions. -// The buffer can be reallocated and the size changed, just make sure -// to update both values correctly. -DLG_API char** dlg_thread_buffer(size_t** size); - -// Untagged leveled logging -#define dlg_trace(...) dlg_log(dlg_level_trace, __VA_ARGS__) -#define dlg_debug(...) dlg_log(dlg_level_debug, __VA_ARGS__) -#define dlg_info(...) dlg_log(dlg_level_info, __VA_ARGS__) -#define dlg_warn(...) dlg_log(dlg_level_warn, __VA_ARGS__) -#define dlg_error(...) dlg_log(dlg_level_error, __VA_ARGS__) -#define dlg_fatal(...) dlg_log(dlg_level_fatal, __VA_ARGS__) - -// Tagged leveled logging -#define dlg_tracet(tags, ...) dlg_logt(dlg_level_trace, tags, __VA_ARGS__) -#define dlg_debugt(tags, ...) dlg_logt(dlg_level_debug, tags, __VA_ARGS__) -#define dlg_infot(tags, ...) dlg_logt(dlg_level_info, tags, __VA_ARGS__) -#define dlg_warnt(tags, ...) dlg_logt(dlg_level_warn, tags, __VA_ARGS__) -#define dlg_errort(tags, ...) dlg_logt(dlg_level_error, tags, __VA_ARGS__) -#define dlg_fatalt(tags, ...) dlg_logt(dlg_level_fatal, tags, __VA_ARGS__) - -// Assert macros useing DLG_DEFAULT_ASSERT as level -#define dlg_assert(expr) dlg_assertl(DLG_DEFAULT_ASSERT, expr) -#define dlg_assertt(tags, expr) dlg_assertlt(DLG_DEFAULT_ASSERT, tags, expr) -#define dlg_assertm(expr, ...) dlg_assertlm(DLG_DEFAULT_ASSERT, expr, __VA_ARGS__) -#define dlg_asserttm(tags, expr, ...) dlg_assertltm(DLG_DEFAULT_ASSERT, tags, expr, __VA_ARGS__) - -// If (expr) does not evaluate to true, always executes 'code' (no matter what -// DLG_ASSERT_LEVEL is or if dlg is disabled or not). -// When dlg is enabled and the level is greater or equal to DLG_ASSERT_LEVEL, -// logs the failed assertion. -// Example usages: -// dlg_assertl_or(dlg_level_warn, data != nullptr, return); -// dlg_assertlm_or(dlg_level_fatal, data != nullptr, return, "Data must not be null"); -// dlg_assert_or(data != nullptr, logError(); return false); -#define dlg_assertltm_or(level, tags, expr, code, ...) dlg__assert_or(level, \ - DLG_CREATE_TAGS tags, expr, code, DLG_FMT_FUNC(__VA_ARGS__)) -#define dlg_assertlm_or(level, expr, code, ...) dlg__assert_or(level, \ - DLG_CREATE_TAGS(NULL), expr, code, DLG_FMT_FUNC(__VA_ARGS__)) -#define dlg_assertl_or(level, expr, code) dlg__assert_or(level, \ - DLG_CREATE_TAGS(NULL), expr, code, NULL) - -#define dlg_assert_or(expr, code) dlg_assertl_or(DLG_DEFAULT_ASSERT, expr, code) -#define dlg_assertm_or(expr, code, ...) dlg_assertlm_or(DLG_DEFAULT_ASSERT, expr, code, __VA_ARGS__) - -#ifdef __cplusplus -} -#endif - -#endif // header guard diff --git a/vendor/freetype/include/dlg/output.h b/vendor/freetype/include/dlg/output.h deleted file mode 100644 index 453e4a5613..0000000000 --- a/vendor/freetype/include/dlg/output.h +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright (c) 2019 nyorain -// Distributed under the Boost Software License, Version 1.0. -// See accompanying file LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt - -#ifndef INC_DLG_OUTPUT_H_ -#define INC_DLG_OUTPUT_H_ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -// Text style -enum dlg_text_style { - dlg_text_style_reset = 0, - dlg_text_style_bold = 1, - dlg_text_style_dim = 2, - dlg_text_style_italic = 3, - dlg_text_style_underline = 4, - dlg_text_style_blink = 5, - dlg_text_style_rblink = 6, - dlg_text_style_reversed = 7, - dlg_text_style_conceal = 8, - dlg_text_style_crossed = 9, - dlg_text_style_none, -}; - -// Text color -enum dlg_color { - dlg_color_black = 0, - dlg_color_red, - dlg_color_green, - dlg_color_yellow, - dlg_color_blue, - dlg_color_magenta, - dlg_color_cyan, - dlg_color_gray, - dlg_color_reset = 9, - - dlg_color_black2 = 60, - dlg_color_red2, - dlg_color_green2, - dlg_color_yellow2, - dlg_color_blue2, - dlg_color_magenta2, - dlg_color_cyan2, - dlg_color_gray2, - - dlg_color_none = 69, -}; - -struct dlg_style { - enum dlg_text_style style; - enum dlg_color fg; - enum dlg_color bg; -}; - -// Like fprintf but fixes utf-8 output to console on windows. -// On non-windows sytems just uses the corresponding standard library -// functions. On windows, if dlg was compiled with the win_console option, -// will first try to output it in a way that allows the default console -// to display utf-8. If that fails, will fall back to the standard -// library functions. -DLG_API int dlg_fprintf(FILE* stream, const char* format, ...) DLG_PRINTF_ATTRIB(2, 3); -DLG_API int dlg_vfprintf(FILE* stream, const char* format, va_list list); - -// Like dlg_printf, but also applies the given style to this output. -// The style will always be applied (using escape sequences), independent of the given stream. -// On windows escape sequences don't work out of the box, see dlg_win_init_ansi(). -DLG_API int dlg_styled_fprintf(FILE* stream, struct dlg_style style, - const char* format, ...) DLG_PRINTF_ATTRIB(3, 4); - -// Features to output from the generic output handler. -// Some features might have only an effect in the specializations. -enum dlg_output_feature { - dlg_output_tags = 1, // output tags list - dlg_output_time = 2, // output time of log call (hour:minute:second) - dlg_output_style = 4, // whether to use the supplied styles - dlg_output_func = 8, // output function - dlg_output_file_line = 16, // output file:line, - dlg_output_newline = 32, // output a newline at the end - dlg_output_threadsafe = 64, // locks stream before printing - dlg_output_time_msecs = 128 // output micro seconds (ms on windows) -}; - -// The default level-dependent output styles. The array values represent the styles -// to be used for the associated level (i.e. [0] for trace level). -DLG_API extern const struct dlg_style dlg_default_output_styles[6]; - -// Generic output function. Used by the default output handler and might be useful -// for custom output handlers (that don't want to manually format the output). -// Will call the given output func with the given data (and format + args to print) -// for everything it has to print in printf format. -// See also the *_stream and *_buf specializations for common usage. -// The given output function must not be NULL. -typedef void(*dlg_generic_output_handler)(void* data, const char* format, ...); -DLG_API void dlg_generic_output(dlg_generic_output_handler output, void* data, - unsigned int features, const struct dlg_origin* origin, const char* string, - const struct dlg_style styles[6]); - -// Generic output function, using a format string instead of feature flags. -// Use following conversion characters: -// %h - output the time in H:M:S format -// %m - output the time in milliseconds -// %t - output the full list of tags, comma separated -// %f - output the function name noted in the origin -// %o - output the file:line of the origin -// %s - print the appropriate style escape sequence. -// %r - print the escape sequence to reset the style. -// %c - The content of the log/assert -// %% - print the '%' character -// Only the above specified conversion characters are valid, the rest are -// written as it is. -DLG_API void dlg_generic_outputf(dlg_generic_output_handler output, void* data, - const char* format_string, const struct dlg_origin* origin, - const char* string, const struct dlg_style styles[6]); - -// Generic output function. Used by the default output handler and might be useful -// for custom output handlers (that don't want to manually format the output). -// If stream is NULL uses stdout. -// Automatically uses dlg_fprintf to assure correct utf-8 even on windows consoles. -// Locks the stream (i.e. assures threadsafe access) when the associated feature -// is passed (note that stdout/stderr might still mix from multiple threads). -DLG_API void dlg_generic_output_stream(FILE* stream, unsigned int features, - const struct dlg_origin* origin, const char* string, - const struct dlg_style styles[6]); -DLG_API void dlg_generic_outputf_stream(FILE* stream, const char* format_string, - const struct dlg_origin* origin, const char* string, - const struct dlg_style styles[6], bool lock_stream); - -// Generic output function (see dlg_generic_output) that uses a buffer instead of -// a stream. buf must at least point to *size bytes. Will set *size to the number -// of bytes written (capped to the given size), if buf == NULL will set *size -// to the needed size. The size parameter must not be NULL. -DLG_API void dlg_generic_output_buf(char* buf, size_t* size, unsigned int features, - const struct dlg_origin* origin, const char* string, - const struct dlg_style styles[6]); -DLG_API void dlg_generic_outputf_buf(char* buf, size_t* size, const char* format_string, - const struct dlg_origin* origin, const char* string, - const struct dlg_style styles[6]); - -// Returns if the given stream is a tty. Useful for custom output handlers -// e.g. to determine whether to use color. -// NOTE: Due to windows limitations currently returns false for wsl ttys. -DLG_API bool dlg_is_tty(FILE* stream); - -// Returns the null-terminated escape sequence for the given style into buf. -// Undefined behvaiour if any member of style has a value outside its enum range (will -// probably result in a buffer overflow or garbage being printed). -// If all member of style are 'none' will simply nullterminate the first buf char. -DLG_API void dlg_escape_sequence(struct dlg_style style, char buf[12]); - -// The reset style escape sequence. -DLG_API extern const char* const dlg_reset_sequence; - -// Just returns true without other effect on non-windows systems or if dlg -// was compiled without the win_console option. -// On windows tries to set the console mode to ansi to make escape sequences work. -// This works only on newer windows 10 versions. Returns false on error. -// Only the first call to it will have an effect, following calls just return the result. -// The function is threadsafe. Automatically called by the default output handler. -// This will only be able to set the mode for the stdout and stderr consoles, so -// other streams to consoles will still not work. -DLG_API bool dlg_win_init_ansi(void); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // header guard diff --git a/vendor/freetype/include/freetype/config/ftconfig.h b/vendor/freetype/include/freetype/config/ftconfig.h index a85151699d..0667493fec 100644 --- a/vendor/freetype/include/freetype/config/ftconfig.h +++ b/vendor/freetype/include/freetype/config/ftconfig.h @@ -4,7 +4,7 @@ * * ANSI-specific configuration file (specification only). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/config/ftheader.h b/vendor/freetype/include/freetype/config/ftheader.h index e607bce15c..f6ef2618de 100644 --- a/vendor/freetype/include/freetype/config/ftheader.h +++ b/vendor/freetype/include/freetype/config/ftheader.h @@ -4,7 +4,7 @@ * * Build macros of the FreeType 2 library. * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/config/ftmodule.h b/vendor/freetype/include/freetype/config/ftmodule.h index b315baba8a..b52779da07 100644 --- a/vendor/freetype/include/freetype/config/ftmodule.h +++ b/vendor/freetype/include/freetype/config/ftmodule.h @@ -1,16 +1,4 @@ -/* - * This file registers the FreeType modules compiled into the library. - * - * If you use GNU make, this file IS NOT USED! Instead, it is created in - * the objects directory (normally `/objs/`) based on information - * from `/modules.cfg`. - * - * Please read `docs/INSTALL.ANY` and `docs/CUSTOMIZE` how to compile - * FreeType without GNU make. - * - */ - -FT_USE_MODULE( FT_Module_Class, autofit_module_class ) +/* This is a generated file. */ FT_USE_MODULE( FT_Driver_ClassRec, tt_driver_class ) FT_USE_MODULE( FT_Driver_ClassRec, t1_driver_class ) FT_USE_MODULE( FT_Driver_ClassRec, cff_driver_class ) @@ -20,14 +8,14 @@ FT_USE_MODULE( FT_Driver_ClassRec, t42_driver_class ) FT_USE_MODULE( FT_Driver_ClassRec, winfnt_driver_class ) FT_USE_MODULE( FT_Driver_ClassRec, pcf_driver_class ) FT_USE_MODULE( FT_Driver_ClassRec, bdf_driver_class ) -FT_USE_MODULE( FT_Module_Class, psaux_module_class ) -FT_USE_MODULE( FT_Module_Class, psnames_module_class ) -FT_USE_MODULE( FT_Module_Class, pshinter_module_class ) FT_USE_MODULE( FT_Module_Class, sfnt_module_class ) +FT_USE_MODULE( FT_Module_Class, autofit_module_class ) +FT_USE_MODULE( FT_Module_Class, pshinter_module_class ) FT_USE_MODULE( FT_Renderer_Class, ft_smooth_renderer_class ) FT_USE_MODULE( FT_Renderer_Class, ft_raster1_renderer_class ) +FT_USE_MODULE( FT_Renderer_Class, ft_svg_renderer_class ) FT_USE_MODULE( FT_Renderer_Class, ft_sdf_renderer_class ) FT_USE_MODULE( FT_Renderer_Class, ft_bitmap_sdf_renderer_class ) -FT_USE_MODULE( FT_Renderer_Class, ft_svg_renderer_class ) - +FT_USE_MODULE( FT_Module_Class, psaux_module_class ) +FT_USE_MODULE( FT_Module_Class, psnames_module_class ) /* EOF */ diff --git a/vendor/freetype/include/freetype/config/ftoption.h b/vendor/freetype/include/freetype/config/ftoption.h index 1976b33af9..1d347a4d42 100644 --- a/vendor/freetype/include/freetype/config/ftoption.h +++ b/vendor/freetype/include/freetype/config/ftoption.h @@ -4,7 +4,7 @@ * * User-selectable configuration macros (specification only). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -273,7 +273,7 @@ FT_BEGIN_HEADER * options set by those programs have precedence, overwriting the value * here with the configured one. */ -/* #define FT_CONFIG_OPTION_USE_PNG */ +/* #define FT_CONFIG_OPTION_USE_PNG /************************************************************************** @@ -757,6 +757,22 @@ FT_BEGIN_HEADER #endif + /************************************************************************** + * + * Option `TT_CONFIG_OPTION_GPOS_KERNING` enables a basic GPOS kerning + * implementation (for TrueType fonts only). With this defined, FreeType + * is able to get kerning pair data from the GPOS 'kern' feature as well as + * legacy 'kern' tables; without this defined, FreeType will only be able + * to use legacy 'kern' tables. + * + * Note that FreeType does not support more advanced GPOS layout features; + * even the 'kern' feature implemented here doesn't handle more + * sophisticated kerning variants. Use a higher-level library like + * HarfBuzz instead for that. + */ +/* #define TT_CONFIG_OPTION_GPOS_KERNING */ + + /*************************************************************************/ /*************************************************************************/ /**** ****/ diff --git a/vendor/freetype/include/freetype/config/ftstdlib.h b/vendor/freetype/include/freetype/config/ftstdlib.h index f65148a902..e17aa7b89d 100644 --- a/vendor/freetype/include/freetype/config/ftstdlib.h +++ b/vendor/freetype/include/freetype/config/ftstdlib.h @@ -5,7 +5,7 @@ * ANSI-specific library and header configuration file (specification * only). * - * Copyright (C) 2002-2023 by + * Copyright (C) 2002-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/config/integer-types.h b/vendor/freetype/include/freetype/config/integer-types.h index 7258b50854..c27505ffc4 100644 --- a/vendor/freetype/include/freetype/config/integer-types.h +++ b/vendor/freetype/include/freetype/config/integer-types.h @@ -4,7 +4,7 @@ * * FreeType integer types definitions. * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/config/mac-support.h b/vendor/freetype/include/freetype/config/mac-support.h index b77b96d5db..07b6f915bd 100644 --- a/vendor/freetype/include/freetype/config/mac-support.h +++ b/vendor/freetype/include/freetype/config/mac-support.h @@ -4,7 +4,7 @@ * * Mac/OS X support configuration header. * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/config/public-macros.h b/vendor/freetype/include/freetype/config/public-macros.h index 23d0fa6a32..f56581a6ee 100644 --- a/vendor/freetype/include/freetype/config/public-macros.h +++ b/vendor/freetype/include/freetype/config/public-macros.h @@ -4,7 +4,7 @@ * * Define a set of compiler macros used in public FreeType headers. * - * Copyright (C) 2020-2023 by + * Copyright (C) 2020-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/freetype.h b/vendor/freetype/include/freetype/freetype.h index 92acf3794a..b88ccc6084 100644 --- a/vendor/freetype/include/freetype/freetype.h +++ b/vendor/freetype/include/freetype/freetype.h @@ -4,7 +4,7 @@ * * FreeType high-level API and common types (specification only). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -1322,9 +1322,13 @@ FT_BEGIN_HEADER * FT_FACE_FLAG_KERNING :: * The face contains kerning information. If set, the kerning distance * can be retrieved using the function @FT_Get_Kerning. Otherwise the - * function always returns the vector (0,0). Note that FreeType - * doesn't handle kerning data from the SFNT 'GPOS' table (as present - * in many OpenType fonts). + * function always returns the vector (0,0). + * + * Note that for TrueType fonts only, FreeType supports both the 'kern' + * table and the basic, pair-wise kerning feature from the 'GPOS' table + * (with `TT_CONFIG_OPTION_GPOS_KERNING` enabled), though FreeType does + * not support the more advanced GPOS layout features; use a library + * like HarfBuzz for those instead. * * FT_FACE_FLAG_FAST_GLYPHS :: * THIS FLAG IS DEPRECATED. DO NOT USE OR TEST IT. @@ -3767,87 +3771,18 @@ FT_BEGIN_HEADER * pixels and use the @FT_PIXEL_MODE_LCD_V mode. * * FT_RENDER_MODE_SDF :: - * This mode corresponds to 8-bit, single-channel signed distance field - * (SDF) bitmaps. Each pixel in the SDF grid is the value from the - * pixel's position to the nearest glyph's outline. The distances are - * calculated from the center of the pixel and are positive if they are - * filled by the outline (i.e., inside the outline) and negative - * otherwise. Check the note below on how to convert the output values - * to usable data. + * The positive (unsigned) 8-bit bitmap values can be converted to the + * single-channel signed distance field (SDF) by subtracting 128, with + * the positive and negative results corresponding to the inside and + * the outside of a glyph contour, respectively. The distance units are + * arbitrarily determined by an adjustable @spread property. * * @note: - * The selected render mode only affects vector glyphs of a font. + * The selected render mode only affects scalable vector glyphs of a font. * Embedded bitmaps often have a different pixel mode like * @FT_PIXEL_MODE_MONO. You can use @FT_Bitmap_Convert to transform them * into 8-bit pixmaps. * - * For @FT_RENDER_MODE_SDF the output bitmap buffer contains normalized - * distances that are packed into unsigned 8-bit values. To get pixel - * values in floating point representation use the following pseudo-C - * code for the conversion. - * - * ``` - * // Load glyph and render using FT_RENDER_MODE_SDF, - * // then use the output buffer as follows. - * - * ... - * FT_Byte buffer = glyph->bitmap->buffer; - * - * - * for pixel in buffer - * { - * // `sd` is the signed distance and `spread` is the current spread; - * // the default spread is 2 and can be changed. - * - * float sd = (float)pixel - 128.0f; - * - * - * // Convert to pixel values. - * sd = ( sd / 128.0f ) * spread; - * - * // Store `sd` in a buffer or use as required. - * } - * - * ``` - * - * FreeType has two rasterizers for generating SDF, namely: - * - * 1. `sdf` for generating SDF directly from glyph's outline, and - * - * 2. `bsdf` for generating SDF from rasterized bitmaps. - * - * Depending on the glyph type (i.e., outline or bitmap), one of the two - * rasterizers is chosen at runtime and used for generating SDFs. To - * force the use of `bsdf` you should render the glyph with any of the - * FreeType's other rendering modes (e.g., `FT_RENDER_MODE_NORMAL`) and - * then re-render with `FT_RENDER_MODE_SDF`. - * - * There are some issues with stability and possible failures of the SDF - * renderers (specifically `sdf`). - * - * 1. The `sdf` rasterizer is sensitive to really small features (e.g., - * sharp turns that are less than 1~pixel) and imperfections in the - * glyph's outline, causing artifacts in the final output. - * - * 2. The `sdf` rasterizer has limited support for handling intersecting - * contours and *cannot* handle self-intersecting contours whatsoever. - * Self-intersection happens when a single connected contour - * intersects itself at some point; having these in your font - * definitely poses a problem to the rasterizer and cause artifacts, - * too. - * - * 3. Generating SDF for really small glyphs may result in undesirable - * output; the pixel grid (which stores distance information) becomes - * too coarse. - * - * 4. Since the output buffer is normalized, precision at smaller spreads - * is greater than precision at larger spread values because the - * output range of [0..255] gets mapped to a smaller SDF range. A - * spread of~2 should be sufficient in most cases. - * - * Points (1) and (2) can be avoided by using the `bsdf` rasterizer, - * which is more stable than the `sdf` rasterizer in general. - * */ typedef enum FT_Render_Mode_ { @@ -4058,9 +3993,26 @@ FT_BEGIN_HEADER * out of the scope of this API function -- they can be implemented * through format-specific interfaces. * - * Kerning for OpenType fonts implemented in a 'GPOS' table is not - * supported; use @FT_HAS_KERNING to find out whether a font has data - * that can be extracted with `FT_Get_Kerning`. + * Note that, for TrueType fonts only, this can extract data from both + * the 'kern' table and the basic, pair-wise kerning feature from the + * GPOS table (with `TT_CONFIG_OPTION_GPOS_KERNING` enabled), though + * FreeType does not support the more advanced GPOS layout features; use + * a library like HarfBuzz for those instead. If a font has both a + * 'kern' table and kern features of a GPOS table, the 'kern' table will + * be used. + * + * Also note for right-to-left scripts, the functionality may differ for + * fonts with GPOS tables vs. 'kern' tables. For GPOS, right-to-left + * fonts typically use both a placement offset and an advance for pair + * positioning, which this API does not support, so it would output + * kerning values of zero; though if the right-to-left font used only + * advances in GPOS pair positioning, then this API could output kerning + * values for it, but it would use `left_glyph` to mean the first glyph + * for that case. Whereas 'kern' tables are always advance-only and + * always store the left glyph first. + * + * Use @FT_HAS_KERNING to find out whether a font has data that can be + * extracted with `FT_Get_Kerning`. */ FT_EXPORT( FT_Error ) FT_Get_Kerning( FT_Face face, diff --git a/vendor/freetype/include/freetype/ftadvanc.h b/vendor/freetype/include/freetype/ftadvanc.h index 4560ded6dc..85b8ba2554 100644 --- a/vendor/freetype/include/freetype/ftadvanc.h +++ b/vendor/freetype/include/freetype/ftadvanc.h @@ -4,7 +4,7 @@ * * Quick computation of advance widths (specification only). * - * Copyright (C) 2008-2023 by + * Copyright (C) 2008-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/ftbbox.h b/vendor/freetype/include/freetype/ftbbox.h index fc21740fc2..12bbfa63a6 100644 --- a/vendor/freetype/include/freetype/ftbbox.h +++ b/vendor/freetype/include/freetype/ftbbox.h @@ -4,7 +4,7 @@ * * FreeType exact bbox computation (specification). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/ftbdf.h b/vendor/freetype/include/freetype/ftbdf.h index e8ce643128..6f63b0b1e7 100644 --- a/vendor/freetype/include/freetype/ftbdf.h +++ b/vendor/freetype/include/freetype/ftbdf.h @@ -4,7 +4,7 @@ * * FreeType API for accessing BDF-specific strings (specification). * - * Copyright (C) 2002-2023 by + * Copyright (C) 2002-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/ftbitmap.h b/vendor/freetype/include/freetype/ftbitmap.h index eb6b4b1eeb..df9d462652 100644 --- a/vendor/freetype/include/freetype/ftbitmap.h +++ b/vendor/freetype/include/freetype/ftbitmap.h @@ -4,7 +4,7 @@ * * FreeType utility functions for bitmaps (specification). * - * Copyright (C) 2004-2023 by + * Copyright (C) 2004-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/ftbzip2.h b/vendor/freetype/include/freetype/ftbzip2.h index 7d29f4682c..c5baea8562 100644 --- a/vendor/freetype/include/freetype/ftbzip2.h +++ b/vendor/freetype/include/freetype/ftbzip2.h @@ -4,7 +4,7 @@ * * Bzip2-compressed stream support. * - * Copyright (C) 2010-2023 by + * Copyright (C) 2010-2024 by * Joel Klinghed. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/ftcache.h b/vendor/freetype/include/freetype/ftcache.h index a2072e26b8..140df4c96c 100644 --- a/vendor/freetype/include/freetype/ftcache.h +++ b/vendor/freetype/include/freetype/ftcache.h @@ -4,7 +4,7 @@ * * FreeType Cache subsystem (specification). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/ftcid.h b/vendor/freetype/include/freetype/ftcid.h index ef22939022..96b2a90fc5 100644 --- a/vendor/freetype/include/freetype/ftcid.h +++ b/vendor/freetype/include/freetype/ftcid.h @@ -4,7 +4,7 @@ * * FreeType API for accessing CID font information (specification). * - * Copyright (C) 2007-2023 by + * Copyright (C) 2007-2024 by * Dereg Clegg and Michael Toftdal. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/ftcolor.h b/vendor/freetype/include/freetype/ftcolor.h index eae200fdf1..420720ddf2 100644 --- a/vendor/freetype/include/freetype/ftcolor.h +++ b/vendor/freetype/include/freetype/ftcolor.h @@ -4,7 +4,7 @@ * * FreeType's glyph color management (specification). * - * Copyright (C) 2018-2023 by + * Copyright (C) 2018-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/ftdriver.h b/vendor/freetype/include/freetype/ftdriver.h index 7af7465bc7..dd31626b03 100644 --- a/vendor/freetype/include/freetype/ftdriver.h +++ b/vendor/freetype/include/freetype/ftdriver.h @@ -4,7 +4,7 @@ * * FreeType API for controlling driver modules (specification only). * - * Copyright (C) 2017-2023 by + * Copyright (C) 2017-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -817,6 +817,80 @@ FT_BEGIN_HEADER * 2.5 */ + + /************************************************************************** + * + * @property: + * spread + * + * @description: + * This property of the 'sdf' and 'bsdf' renderers defines how the signed + * distance field (SDF) is represented in the output bitmap. The output + * values are calculated as follows, '128 * ( SDF / spread + 1 )', with + * the result clamped to the 8-bit range [0..255]. Therefore, 'spread' + * is also the maximum euclidean distance from the edge after which the + * values are clamped. The spread is specified in pixels with the + * default value of 8. For accurate SDF texture mapping (interpolation), + * the spread should be large enough to accommodate the target grid unit. + * + * @example: + * The following example code demonstrates how to set the SDF spread + * (omitting the error handling). + * + * ``` + * FT_Library library; + * FT_Int spread = 2; + * + * + * FT_Init_FreeType( &library ); + * + * FT_Property_Set( library, "sdf", "spread", &spread ); + * ``` + * + * @note + * FreeType has two rasterizers for generating SDF, namely: + * + * 1. `sdf` for generating SDF directly from glyph's outline, and + * + * 2. `bsdf` for generating SDF from rasterized bitmaps. + * + * Depending on the glyph type (i.e., outline or bitmap), one of the two + * rasterizers is chosen at runtime and used for generating SDFs. To + * force the use of `bsdf` you should render the glyph with any of the + * FreeType's other rendering modes (e.g., `FT_RENDER_MODE_NORMAL`) and + * then re-render with `FT_RENDER_MODE_SDF`. + * + * There are some issues with stability and possible failures of the SDF + * renderers (specifically `sdf`). + * + * 1. The `sdf` rasterizer is sensitive to really small features (e.g., + * sharp turns that are less than 1~pixel) and imperfections in the + * glyph's outline, causing artifacts in the final output. + * + * 2. The `sdf` rasterizer has limited support for handling intersecting + * contours and *cannot* handle self-intersecting contours whatsoever. + * Self-intersection happens when a single connected contour + * intersects itself at some point; having these in your font + * definitely poses a problem to the rasterizer and cause artifacts, + * too. + * + * 3. Generating SDF for really small glyphs may result in undesirable + * output; the pixel grid (which stores distance information) becomes + * too coarse. + * + * 4. Since the output buffer is normalized, precision at smaller spreads + * is greater than precision at larger spread values because the + * output range of [0..255] gets mapped to a smaller SDF range. A + * spread of~2 should be sufficient in most cases. + * + * Points (1) and (2) can be avoided by using the `bsdf` rasterizer, + * which is more stable than the `sdf` rasterizer in general. + * + * @since: + * 2.11 + */ + + /************************************************************************** * * @property: diff --git a/vendor/freetype/include/freetype/fterrdef.h b/vendor/freetype/include/freetype/fterrdef.h index d59b3cc2da..710ca91bbd 100644 --- a/vendor/freetype/include/freetype/fterrdef.h +++ b/vendor/freetype/include/freetype/fterrdef.h @@ -4,7 +4,7 @@ * * FreeType error codes (specification). * - * Copyright (C) 2002-2023 by + * Copyright (C) 2002-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/fterrors.h b/vendor/freetype/include/freetype/fterrors.h index 15ef3f76b5..27c0ece5c1 100644 --- a/vendor/freetype/include/freetype/fterrors.h +++ b/vendor/freetype/include/freetype/fterrors.h @@ -4,7 +4,7 @@ * * FreeType error code handling (specification). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/ftfntfmt.h b/vendor/freetype/include/freetype/ftfntfmt.h index c0018fc830..7c8b0874a8 100644 --- a/vendor/freetype/include/freetype/ftfntfmt.h +++ b/vendor/freetype/include/freetype/ftfntfmt.h @@ -4,7 +4,7 @@ * * Support functions for font formats. * - * Copyright (C) 2002-2023 by + * Copyright (C) 2002-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/ftgasp.h b/vendor/freetype/include/freetype/ftgasp.h index d5f19add8f..30e5a9bf82 100644 --- a/vendor/freetype/include/freetype/ftgasp.h +++ b/vendor/freetype/include/freetype/ftgasp.h @@ -4,7 +4,7 @@ * * Access of TrueType's 'gasp' table (specification). * - * Copyright (C) 2007-2023 by + * Copyright (C) 2007-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/ftglyph.h b/vendor/freetype/include/freetype/ftglyph.h index 4658895f7a..dc1eb8873a 100644 --- a/vendor/freetype/include/freetype/ftglyph.h +++ b/vendor/freetype/include/freetype/ftglyph.h @@ -4,7 +4,7 @@ * * FreeType convenience functions to handle glyphs (specification). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/ftgxval.h b/vendor/freetype/include/freetype/ftgxval.h index e8de9a6ed5..065cd53cc5 100644 --- a/vendor/freetype/include/freetype/ftgxval.h +++ b/vendor/freetype/include/freetype/ftgxval.h @@ -4,7 +4,7 @@ * * FreeType API for validating TrueTypeGX/AAT tables (specification). * - * Copyright (C) 2004-2023 by + * Copyright (C) 2004-2024 by * Masatake YAMATO, Redhat K.K, * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/vendor/freetype/include/freetype/ftgzip.h b/vendor/freetype/include/freetype/ftgzip.h index 443ec29db1..9516dc030a 100644 --- a/vendor/freetype/include/freetype/ftgzip.h +++ b/vendor/freetype/include/freetype/ftgzip.h @@ -4,7 +4,7 @@ * * Gzip-compressed stream support. * - * Copyright (C) 2002-2023 by + * Copyright (C) 2002-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/ftimage.h b/vendor/freetype/include/freetype/ftimage.h index 6baa812560..6c7085f616 100644 --- a/vendor/freetype/include/freetype/ftimage.h +++ b/vendor/freetype/include/freetype/ftimage.h @@ -5,7 +5,7 @@ * FreeType glyph image formats and default raster interface * (specification). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -21,6 +21,10 @@ * Note: A 'raster' is simply a scan-line converter, used to render * `FT_Outline`s into `FT_Bitmap`s. * + * Note: This file can be used for STANDALONE_ compilation of raster (B/W) + * and smooth (anti-aliased) renderers. Therefore, it must rely on + * standard variable types only rather than aliases in fttypes.h. + * */ @@ -318,7 +322,7 @@ FT_BEGIN_HEADER * * If bit~2 is set, bits 5-7 contain the drop-out mode (as defined in * the OpenType specification; the value is the same as the argument to - * the 'SCANMODE' instruction). + * the 'SCANTYPE' instruction). * * Bits 3 and~4 are reserved for internal purposes. * @@ -341,14 +345,14 @@ FT_BEGIN_HEADER */ typedef struct FT_Outline_ { - short n_contours; /* number of contours in glyph */ - short n_points; /* number of points in the glyph */ + unsigned short n_contours; /* number of contours in glyph */ + unsigned short n_points; /* number of points in the glyph */ - FT_Vector* points; /* the outline's points */ - char* tags; /* the points flags */ - short* contours; /* the contour end points */ + FT_Vector* points; /* the outline's points */ + unsigned char* tags; /* the points flags */ + unsigned short* contours; /* the contour end points */ - int flags; /* outline masks */ + int flags; /* outline masks */ } FT_Outline; @@ -356,8 +360,8 @@ FT_BEGIN_HEADER /* Following limits must be consistent with */ /* FT_Outline.{n_contours,n_points} */ -#define FT_OUTLINE_CONTOURS_MAX SHRT_MAX -#define FT_OUTLINE_POINTS_MAX SHRT_MAX +#define FT_OUTLINE_CONTOURS_MAX USHRT_MAX +#define FT_OUTLINE_POINTS_MAX USHRT_MAX /************************************************************************** @@ -434,8 +438,8 @@ FT_BEGIN_HEADER * rasterizer; see the `tags` field in @FT_Outline. * * Please refer to the description of the 'SCANTYPE' instruction in the - * OpenType specification (in file `ttinst1.doc`) how simple drop-outs, - * smart drop-outs, and stubs are defined. + * [OpenType specification](https://learn.microsoft.com/en-us/typography/opentype/spec/tt_instructions#scantype) + * how simple drop-outs, smart drop-outs, and stubs are defined. */ #define FT_OUTLINE_NONE 0x0 #define FT_OUTLINE_OWNER 0x1 diff --git a/vendor/freetype/include/freetype/ftincrem.h b/vendor/freetype/include/freetype/ftincrem.h index 2d4f5def24..816581b78e 100644 --- a/vendor/freetype/include/freetype/ftincrem.h +++ b/vendor/freetype/include/freetype/ftincrem.h @@ -4,7 +4,7 @@ * * FreeType incremental loading (specification). * - * Copyright (C) 2002-2023 by + * Copyright (C) 2002-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/ftlcdfil.h b/vendor/freetype/include/freetype/ftlcdfil.h index d3723e16f6..25274dc4ac 100644 --- a/vendor/freetype/include/freetype/ftlcdfil.h +++ b/vendor/freetype/include/freetype/ftlcdfil.h @@ -5,7 +5,7 @@ * FreeType API for color filtering of subpixel bitmap glyphs * (specification). * - * Copyright (C) 2006-2023 by + * Copyright (C) 2006-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/ftlist.h b/vendor/freetype/include/freetype/ftlist.h index b553131335..972fbfa2fe 100644 --- a/vendor/freetype/include/freetype/ftlist.h +++ b/vendor/freetype/include/freetype/ftlist.h @@ -4,7 +4,7 @@ * * Generic list support for FreeType (specification). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/ftlogging.h b/vendor/freetype/include/freetype/ftlogging.h index 53b8b89642..1813cfc2c2 100644 --- a/vendor/freetype/include/freetype/ftlogging.h +++ b/vendor/freetype/include/freetype/ftlogging.h @@ -4,7 +4,7 @@ * * Additional debugging APIs. * - * Copyright (C) 2020-2023 by + * Copyright (C) 2020-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/ftlzw.h b/vendor/freetype/include/freetype/ftlzw.h index adfd172479..bcf59ba706 100644 --- a/vendor/freetype/include/freetype/ftlzw.h +++ b/vendor/freetype/include/freetype/ftlzw.h @@ -4,7 +4,7 @@ * * LZW-compressed stream support. * - * Copyright (C) 2004-2023 by + * Copyright (C) 2004-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/ftmac.h b/vendor/freetype/include/freetype/ftmac.h index a91e38f9ea..e4efde33dd 100644 --- a/vendor/freetype/include/freetype/ftmac.h +++ b/vendor/freetype/include/freetype/ftmac.h @@ -4,7 +4,7 @@ * * Additional Mac-specific API. * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/ftmm.h b/vendor/freetype/include/freetype/ftmm.h index d145128a9b..35ed039c89 100644 --- a/vendor/freetype/include/freetype/ftmm.h +++ b/vendor/freetype/include/freetype/ftmm.h @@ -4,7 +4,7 @@ * * FreeType Multiple Master font interface (specification). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -19,8 +19,13 @@ #ifndef FTMM_H_ #define FTMM_H_ +#include -#include +#ifdef FREETYPE_H +#error "freetype.h of FreeType 1 has been loaded!" +#error "Please fix the directory search order for header files" +#error "so that freetype.h of FreeType 2 is found first." +#endif FT_BEGIN_HEADER @@ -53,6 +58,30 @@ FT_BEGIN_HEADER */ + /************************************************************************** + * + * @enum: + * T1_MAX_MM_XXX + * + * @description: + * Multiple Masters limits as defined in their specifications. + * + * @values: + * T1_MAX_MM_AXIS :: + * The maximum number of Multiple Masters axes. + * + * T1_MAX_MM_DESIGNS :: + * The maximum number of Multiple Masters designs. + * + * T1_MAX_MM_MAP_POINTS :: + * The maximum number of elements in a design map. + * + */ +#define T1_MAX_MM_AXIS 4 +#define T1_MAX_MM_DESIGNS 16 +#define T1_MAX_MM_MAP_POINTS 20 + + /************************************************************************** * * @struct: diff --git a/vendor/freetype/include/freetype/ftmodapi.h b/vendor/freetype/include/freetype/ftmodapi.h index c8f0c2c2a4..0ee715898f 100644 --- a/vendor/freetype/include/freetype/ftmodapi.h +++ b/vendor/freetype/include/freetype/ftmodapi.h @@ -4,7 +4,7 @@ * * FreeType modules public interface (specification). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/ftmoderr.h b/vendor/freetype/include/freetype/ftmoderr.h index c8c892dcce..6722fbf8b7 100644 --- a/vendor/freetype/include/freetype/ftmoderr.h +++ b/vendor/freetype/include/freetype/ftmoderr.h @@ -4,7 +4,7 @@ * * FreeType module error offsets (specification). * - * Copyright (C) 2001-2023 by + * Copyright (C) 2001-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/ftotval.h b/vendor/freetype/include/freetype/ftotval.h index 011bdfc837..810200b386 100644 --- a/vendor/freetype/include/freetype/ftotval.h +++ b/vendor/freetype/include/freetype/ftotval.h @@ -4,7 +4,7 @@ * * FreeType API for validating OpenType tables (specification). * - * Copyright (C) 2004-2023 by + * Copyright (C) 2004-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/ftoutln.h b/vendor/freetype/include/freetype/ftoutln.h index f9329ca40c..44e94b4f5b 100644 --- a/vendor/freetype/include/freetype/ftoutln.h +++ b/vendor/freetype/include/freetype/ftoutln.h @@ -5,7 +5,7 @@ * Support for the FT_Outline type used to store glyph shapes of * most scalable font formats (specification). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -112,7 +112,7 @@ FT_BEGIN_HEADER * Degenerate contours, segments, and Bezier arcs may be reported. In * most cases, it is best to filter these out before using the outline * for stroking or other path modification purposes (which may cause - * degenerate segments to become non-degenrate and visible, like when + * degenerate segments to become non-degenerate and visible, like when * stroke caps are used or the path is otherwise outset). Some glyph * outlines may contain deliberate degenerate single points for mark * attachement. diff --git a/vendor/freetype/include/freetype/ftparams.h b/vendor/freetype/include/freetype/ftparams.h index 6a9f243bc9..43bf69c202 100644 --- a/vendor/freetype/include/freetype/ftparams.h +++ b/vendor/freetype/include/freetype/ftparams.h @@ -4,7 +4,7 @@ * * FreeType API for possible FT_Parameter tags (specification only). * - * Copyright (C) 2017-2023 by + * Copyright (C) 2017-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/ftpfr.h b/vendor/freetype/include/freetype/ftpfr.h index 7111d40a0c..1a712b9552 100644 --- a/vendor/freetype/include/freetype/ftpfr.h +++ b/vendor/freetype/include/freetype/ftpfr.h @@ -4,7 +4,7 @@ * * FreeType API for accessing PFR-specific data (specification only). * - * Copyright (C) 2002-2023 by + * Copyright (C) 2002-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/ftrender.h b/vendor/freetype/include/freetype/ftrender.h index 0b6fad32e8..dc5018a1b5 100644 --- a/vendor/freetype/include/freetype/ftrender.h +++ b/vendor/freetype/include/freetype/ftrender.h @@ -4,7 +4,7 @@ * * FreeType renderer modules public interface (specification). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/ftsizes.h b/vendor/freetype/include/freetype/ftsizes.h index 7bfb1aed4c..4ef5c7955d 100644 --- a/vendor/freetype/include/freetype/ftsizes.h +++ b/vendor/freetype/include/freetype/ftsizes.h @@ -4,7 +4,7 @@ * * FreeType size objects management (specification). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/ftsnames.h b/vendor/freetype/include/freetype/ftsnames.h index 9d5d22bb25..d5d5cd9310 100644 --- a/vendor/freetype/include/freetype/ftsnames.h +++ b/vendor/freetype/include/freetype/ftsnames.h @@ -7,7 +7,7 @@ * * This is _not_ used to retrieve glyph names! * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/ftstroke.h b/vendor/freetype/include/freetype/ftstroke.h index b3d90802a5..41626dc9d7 100644 --- a/vendor/freetype/include/freetype/ftstroke.h +++ b/vendor/freetype/include/freetype/ftstroke.h @@ -4,7 +4,7 @@ * * FreeType path stroker (specification). * - * Copyright (C) 2002-2023 by + * Copyright (C) 2002-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/ftsynth.h b/vendor/freetype/include/freetype/ftsynth.h index af90967dda..43081b6c33 100644 --- a/vendor/freetype/include/freetype/ftsynth.h +++ b/vendor/freetype/include/freetype/ftsynth.h @@ -5,7 +5,7 @@ * FreeType synthesizing code for emboldening and slanting * (specification). * - * Copyright (C) 2000-2023 by + * Copyright (C) 2000-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/ftsystem.h b/vendor/freetype/include/freetype/ftsystem.h index 3a08f4912c..1eacb3af39 100644 --- a/vendor/freetype/include/freetype/ftsystem.h +++ b/vendor/freetype/include/freetype/ftsystem.h @@ -4,7 +4,7 @@ * * FreeType low-level system interface definition (specification). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/fttrigon.h b/vendor/freetype/include/freetype/fttrigon.h index 294981a6f3..a5299e938d 100644 --- a/vendor/freetype/include/freetype/fttrigon.h +++ b/vendor/freetype/include/freetype/fttrigon.h @@ -4,7 +4,7 @@ * * FreeType trigonometric functions (specification). * - * Copyright (C) 2001-2023 by + * Copyright (C) 2001-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/fttypes.h b/vendor/freetype/include/freetype/fttypes.h index 5b109f0c73..27815143a6 100644 --- a/vendor/freetype/include/freetype/fttypes.h +++ b/vendor/freetype/include/freetype/fttypes.h @@ -4,7 +4,7 @@ * * FreeType simple types definitions (specification only). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/ftwinfnt.h b/vendor/freetype/include/freetype/ftwinfnt.h index 7b701ea59b..2591e58866 100644 --- a/vendor/freetype/include/freetype/ftwinfnt.h +++ b/vendor/freetype/include/freetype/ftwinfnt.h @@ -4,7 +4,7 @@ * * FreeType API for accessing Windows fnt-specific data. * - * Copyright (C) 2003-2023 by + * Copyright (C) 2003-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/internal/autohint.h b/vendor/freetype/include/freetype/internal/autohint.h index bf9c8b7cf2..8865d53b38 100644 --- a/vendor/freetype/include/freetype/internal/autohint.h +++ b/vendor/freetype/include/freetype/internal/autohint.h @@ -4,7 +4,7 @@ * * High-level 'autohint' module-specific interface (specification). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/internal/cffotypes.h b/vendor/freetype/include/freetype/internal/cffotypes.h index 50d5353849..36b0390a5a 100644 --- a/vendor/freetype/include/freetype/internal/cffotypes.h +++ b/vendor/freetype/include/freetype/internal/cffotypes.h @@ -4,7 +4,7 @@ * * Basic OpenType/CFF object type definitions (specification). * - * Copyright (C) 2017-2023 by + * Copyright (C) 2017-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/internal/cfftypes.h b/vendor/freetype/include/freetype/internal/cfftypes.h index c2521764ca..ef2e8e7569 100644 --- a/vendor/freetype/include/freetype/internal/cfftypes.h +++ b/vendor/freetype/include/freetype/internal/cfftypes.h @@ -5,7 +5,7 @@ * Basic OpenType/CFF type definitions and interface (specification * only). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -248,10 +248,10 @@ FT_BEGIN_HEADER FT_Byte num_family_blues; FT_Byte num_family_other_blues; - FT_Pos blue_values[14]; - FT_Pos other_blues[10]; - FT_Pos family_blues[14]; - FT_Pos family_other_blues[10]; + FT_Fixed blue_values[14]; + FT_Fixed other_blues[10]; + FT_Fixed family_blues[14]; + FT_Fixed family_other_blues[10]; FT_Fixed blue_scale; FT_Pos blue_shift; diff --git a/vendor/freetype/include/freetype/internal/compiler-macros.h b/vendor/freetype/include/freetype/internal/compiler-macros.h index 6f67650979..876f66e256 100644 --- a/vendor/freetype/include/freetype/internal/compiler-macros.h +++ b/vendor/freetype/include/freetype/internal/compiler-macros.h @@ -4,7 +4,7 @@ * * Compiler-specific macro definitions used internally by FreeType. * - * Copyright (C) 2020-2023 by + * Copyright (C) 2020-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/internal/ftcalc.h b/vendor/freetype/include/freetype/internal/ftcalc.h index d9aea23602..40634602f1 100644 --- a/vendor/freetype/include/freetype/internal/ftcalc.h +++ b/vendor/freetype/include/freetype/internal/ftcalc.h @@ -4,7 +4,7 @@ * * Arithmetic computations (specification). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -455,6 +455,12 @@ FT_BEGIN_HEADER #define FT_MSB( x ) FT_MSB_i386( x ) +#elif defined( __SunOS_5_11 ) + +#include + +#define FT_MSB( x ) ( fls( x ) - 1 ) + #elif defined( __DECC ) || defined( __DECCXX ) #include @@ -489,8 +495,6 @@ FT_BEGIN_HEADER FT_Fixed y ); -#if 0 - /************************************************************************** * * @function: @@ -507,12 +511,11 @@ FT_BEGIN_HEADER * The result of 'sqrt(x)'. * * @note: - * This function is not very fast. + * This function is slow and should be avoided. Consider `FT_Hypot` or + * `FT_Vector_NormLen' instead. */ - FT_BASE( FT_Int32 ) - FT_SqrtFixed( FT_Int32 x ); - -#endif /* 0 */ + FT_BASE( FT_UInt32 ) + FT_SqrtFixed( FT_UInt32 x ); #define INT_TO_F26DOT6( x ) ( (FT_Long)(x) * 64 ) /* << 6 */ diff --git a/vendor/freetype/include/freetype/internal/ftdebug.h b/vendor/freetype/include/freetype/internal/ftdebug.h index 4e013ba1e2..d7fa8dc93c 100644 --- a/vendor/freetype/include/freetype/internal/ftdebug.h +++ b/vendor/freetype/include/freetype/internal/ftdebug.h @@ -4,7 +4,7 @@ * * Debugging and logging component (specification). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/internal/ftdrv.h b/vendor/freetype/include/freetype/internal/ftdrv.h index 9001c07ad0..5609b3ef12 100644 --- a/vendor/freetype/include/freetype/internal/ftdrv.h +++ b/vendor/freetype/include/freetype/internal/ftdrv.h @@ -4,7 +4,7 @@ * * FreeType internal font driver interface (specification). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/internal/ftgloadr.h b/vendor/freetype/include/freetype/internal/ftgloadr.h index 36e5509f9e..f1c155b162 100644 --- a/vendor/freetype/include/freetype/internal/ftgloadr.h +++ b/vendor/freetype/include/freetype/internal/ftgloadr.h @@ -4,7 +4,7 @@ * * The FreeType glyph loader (specification). * - * Copyright (C) 2002-2023 by + * Copyright (C) 2002-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/internal/ftmemory.h b/vendor/freetype/include/freetype/internal/ftmemory.h index 5eb1d21ff6..4e05a29f13 100644 --- a/vendor/freetype/include/freetype/internal/ftmemory.h +++ b/vendor/freetype/include/freetype/internal/ftmemory.h @@ -4,7 +4,7 @@ * * The FreeType memory management macros (specification). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg * * This file is part of the FreeType project, and may only be used, @@ -371,8 +371,11 @@ extern "C++" #define FT_STRDUP( dst, str ) \ FT_MEM_SET_ERROR( FT_MEM_STRDUP( dst, str ) ) -#define FT_MEM_DUP( dst, address, size ) \ - (dst) = ft_mem_dup( memory, (address), (FT_ULong)(size), &error ) +#define FT_MEM_DUP( dst, address, size ) \ + FT_ASSIGNP_INNER( dst, ft_mem_dup( memory, \ + (address), \ + (FT_ULong)(size), \ + &error ) ) #define FT_DUP( dst, address, size ) \ FT_MEM_SET_ERROR( FT_MEM_DUP( dst, address, size ) ) diff --git a/vendor/freetype/include/freetype/internal/ftmmtypes.h b/vendor/freetype/include/freetype/internal/ftmmtypes.h index c4b21d6144..8449e7a010 100644 --- a/vendor/freetype/include/freetype/internal/ftmmtypes.h +++ b/vendor/freetype/include/freetype/internal/ftmmtypes.h @@ -5,7 +5,7 @@ * OpenType Variations type definitions for internal use * with the multi-masters service (specification). * - * Copyright (C) 2022-2023 by + * Copyright (C) 2022-2024 by * David Turner, Robert Wilhelm, Werner Lemberg, George Williams, and * Dominik Röttsches. * diff --git a/vendor/freetype/include/freetype/internal/ftobjs.h b/vendor/freetype/include/freetype/internal/ftobjs.h index 28bc9b65f0..e6333c2aa2 100644 --- a/vendor/freetype/include/freetype/internal/ftobjs.h +++ b/vendor/freetype/include/freetype/internal/ftobjs.h @@ -4,7 +4,7 @@ * * The FreeType private base classes (specification). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/internal/ftpsprop.h b/vendor/freetype/include/freetype/internal/ftpsprop.h index 1d5b287ad2..4f11aa16ba 100644 --- a/vendor/freetype/include/freetype/internal/ftpsprop.h +++ b/vendor/freetype/include/freetype/internal/ftpsprop.h @@ -4,7 +4,7 @@ * * Get and set properties of PostScript drivers (specification). * - * Copyright (C) 2017-2023 by + * Copyright (C) 2017-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/internal/ftrfork.h b/vendor/freetype/include/freetype/internal/ftrfork.h index e96459921e..05c1d6c48b 100644 --- a/vendor/freetype/include/freetype/internal/ftrfork.h +++ b/vendor/freetype/include/freetype/internal/ftrfork.h @@ -4,7 +4,7 @@ * * Embedded resource forks accessor (specification). * - * Copyright (C) 2004-2023 by + * Copyright (C) 2004-2024 by * Masatake YAMATO and Redhat K.K. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/internal/ftserv.h b/vendor/freetype/include/freetype/internal/ftserv.h index 1e85d6d385..8c35dbd713 100644 --- a/vendor/freetype/include/freetype/internal/ftserv.h +++ b/vendor/freetype/include/freetype/internal/ftserv.h @@ -4,7 +4,7 @@ * * The FreeType services (specification only). * - * Copyright (C) 2003-2023 by + * Copyright (C) 2003-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/internal/ftstream.h b/vendor/freetype/include/freetype/internal/ftstream.h index 88e19287c8..fd52f767ef 100644 --- a/vendor/freetype/include/freetype/internal/ftstream.h +++ b/vendor/freetype/include/freetype/internal/ftstream.h @@ -4,7 +4,7 @@ * * Stream handling (specification). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/internal/fttrace.h b/vendor/freetype/include/freetype/internal/fttrace.h index 319fe56fd2..42595a29ff 100644 --- a/vendor/freetype/include/freetype/internal/fttrace.h +++ b/vendor/freetype/include/freetype/internal/fttrace.h @@ -4,7 +4,7 @@ * * Tracing handling (specification only). * - * Copyright (C) 2002-2023 by + * Copyright (C) 2002-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -64,6 +64,7 @@ FT_TRACE_DEF( ttbdf ) /* TrueType embedded BDF (ttbdf.c) */ FT_TRACE_DEF( ttcmap ) /* charmap handler (ttcmap.c) */ FT_TRACE_DEF( ttcolr ) /* glyph layer table (ttcolr.c) */ FT_TRACE_DEF( ttcpal ) /* color palette table (ttcpal.c) */ +FT_TRACE_DEF( ttgpos ) /* GPOS handler (ttgpos.c) */ FT_TRACE_DEF( ttsvg ) /* OpenType SVG table (ttsvg.c) */ FT_TRACE_DEF( ttkern ) /* kerning handler (ttkern.c) */ FT_TRACE_DEF( ttload ) /* basic TrueType tables (ttload.c) */ diff --git a/vendor/freetype/include/freetype/internal/ftvalid.h b/vendor/freetype/include/freetype/internal/ftvalid.h index e98ee4e473..a1312f2aba 100644 --- a/vendor/freetype/include/freetype/internal/ftvalid.h +++ b/vendor/freetype/include/freetype/internal/ftvalid.h @@ -4,7 +4,7 @@ * * FreeType validation support (specification). * - * Copyright (C) 2004-2023 by + * Copyright (C) 2004-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/internal/psaux.h b/vendor/freetype/include/freetype/internal/psaux.h index dfb1987f86..745d2cb56b 100644 --- a/vendor/freetype/include/freetype/internal/psaux.h +++ b/vendor/freetype/include/freetype/internal/psaux.h @@ -5,7 +5,7 @@ * Auxiliary functions and data structures related to PostScript fonts * (specification). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -225,6 +225,7 @@ FT_BEGIN_HEADER typedef enum T1_FieldLocation_ { + T1_FIELD_LOCATION_NONE = 0, T1_FIELD_LOCATION_CID_INFO, T1_FIELD_LOCATION_FONT_DICT, T1_FIELD_LOCATION_FONT_EXTRA, @@ -249,6 +250,7 @@ FT_BEGIN_HEADER /* structure type used to model object fields */ typedef struct T1_FieldRec_ { + FT_UInt len; /* field identifier length */ const char* ident; /* field identifier */ T1_FieldLocation location; T1_FieldType type; /* type of field */ @@ -273,8 +275,9 @@ FT_BEGIN_HEADER #define T1_NEW_SIMPLE_FIELD( _ident, _type, _fname, _dict ) \ { \ + sizeof ( _ident ) - 1, \ _ident, T1CODE, _type, \ - 0, \ + NULL, \ FT_FIELD_OFFSET( _fname ), \ FT_FIELD_SIZE( _fname ), \ 0, 0, \ @@ -283,6 +286,7 @@ FT_BEGIN_HEADER #define T1_NEW_CALLBACK_FIELD( _ident, _reader, _dict ) \ { \ + sizeof ( _ident ) - 1, \ _ident, T1CODE, T1_FIELD_TYPE_CALLBACK, \ (T1_Field_ParseFunc)_reader, \ 0, 0, \ @@ -292,8 +296,9 @@ FT_BEGIN_HEADER #define T1_NEW_TABLE_FIELD( _ident, _type, _fname, _max, _dict ) \ { \ + sizeof ( _ident ) - 1, \ _ident, T1CODE, _type, \ - 0, \ + NULL, \ FT_FIELD_OFFSET( _fname ), \ FT_FIELD_SIZE_DELTA( _fname ), \ _max, \ @@ -303,8 +308,9 @@ FT_BEGIN_HEADER #define T1_NEW_TABLE_FIELD2( _ident, _type, _fname, _max, _dict ) \ { \ + sizeof ( _ident ) - 1, \ _ident, T1CODE, _type, \ - 0, \ + NULL, \ FT_FIELD_OFFSET( _fname ), \ FT_FIELD_SIZE_DELTA( _fname ), \ _max, 0, \ @@ -354,6 +360,13 @@ FT_BEGIN_HEADER #define T1_FIELD_CALLBACK( _ident, _name, _dict ) \ T1_NEW_CALLBACK_FIELD( _ident, _name, _dict ) +#define T1_FIELD_ZERO \ + { \ + 0, \ + NULL, T1_FIELD_LOCATION_NONE, T1_FIELD_TYPE_NONE, \ + NULL, 0, 0, 0, 0, 0 \ + } + /*************************************************************************/ /*************************************************************************/ diff --git a/vendor/freetype/include/freetype/internal/pshints.h b/vendor/freetype/include/freetype/internal/pshints.h index ededc4c72e..dba6c7303f 100644 --- a/vendor/freetype/include/freetype/internal/pshints.h +++ b/vendor/freetype/include/freetype/internal/pshints.h @@ -6,7 +6,7 @@ * recorders (specification only). These are used to support native * T1/T2 hints in the 'type1', 'cid', and 'cff' font drivers. * - * Copyright (C) 2001-2023 by + * Copyright (C) 2001-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/internal/services/svbdf.h b/vendor/freetype/include/freetype/internal/services/svbdf.h index bf0c1dcc71..89e9c2e5de 100644 --- a/vendor/freetype/include/freetype/internal/services/svbdf.h +++ b/vendor/freetype/include/freetype/internal/services/svbdf.h @@ -4,7 +4,7 @@ * * The FreeType BDF services (specification). * - * Copyright (C) 2003-2023 by + * Copyright (C) 2003-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/internal/services/svcfftl.h b/vendor/freetype/include/freetype/internal/services/svcfftl.h index 4a20498ee0..3cb483c344 100644 --- a/vendor/freetype/include/freetype/internal/services/svcfftl.h +++ b/vendor/freetype/include/freetype/internal/services/svcfftl.h @@ -4,7 +4,7 @@ * * The FreeType CFF tables loader service (specification). * - * Copyright (C) 2017-2023 by + * Copyright (C) 2017-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/internal/services/svcid.h b/vendor/freetype/include/freetype/internal/services/svcid.h index 06d0cb8fd6..8362cb8724 100644 --- a/vendor/freetype/include/freetype/internal/services/svcid.h +++ b/vendor/freetype/include/freetype/internal/services/svcid.h @@ -4,7 +4,7 @@ * * The FreeType CID font services (specification). * - * Copyright (C) 2007-2023 by + * Copyright (C) 2007-2024 by * Derek Clegg and Michael Toftdal. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/internal/services/svfntfmt.h b/vendor/freetype/include/freetype/internal/services/svfntfmt.h index bc45e80568..6b837e79fc 100644 --- a/vendor/freetype/include/freetype/internal/services/svfntfmt.h +++ b/vendor/freetype/include/freetype/internal/services/svfntfmt.h @@ -4,7 +4,7 @@ * * The FreeType font format service (specification only). * - * Copyright (C) 2003-2023 by + * Copyright (C) 2003-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/internal/services/svgldict.h b/vendor/freetype/include/freetype/internal/services/svgldict.h index 6437abfbf2..6126ec9ada 100644 --- a/vendor/freetype/include/freetype/internal/services/svgldict.h +++ b/vendor/freetype/include/freetype/internal/services/svgldict.h @@ -4,7 +4,7 @@ * * The FreeType glyph dictionary services (specification). * - * Copyright (C) 2003-2023 by + * Copyright (C) 2003-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/internal/services/svgxval.h b/vendor/freetype/include/freetype/internal/services/svgxval.h index 31016afe0d..29cf552818 100644 --- a/vendor/freetype/include/freetype/internal/services/svgxval.h +++ b/vendor/freetype/include/freetype/internal/services/svgxval.h @@ -4,7 +4,7 @@ * * FreeType API for validating TrueTypeGX/AAT tables (specification). * - * Copyright (C) 2004-2023 by + * Copyright (C) 2004-2024 by * Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/vendor/freetype/include/freetype/internal/services/svkern.h b/vendor/freetype/include/freetype/internal/services/svkern.h index bcabbc3e68..ac1bc30c41 100644 --- a/vendor/freetype/include/freetype/internal/services/svkern.h +++ b/vendor/freetype/include/freetype/internal/services/svkern.h @@ -4,7 +4,7 @@ * * The FreeType Kerning service (specification). * - * Copyright (C) 2006-2023 by + * Copyright (C) 2006-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/internal/services/svmetric.h b/vendor/freetype/include/freetype/internal/services/svmetric.h index 167617ebb3..8b3563b25c 100644 --- a/vendor/freetype/include/freetype/internal/services/svmetric.h +++ b/vendor/freetype/include/freetype/internal/services/svmetric.h @@ -4,7 +4,7 @@ * * The FreeType services for metrics variations (specification). * - * Copyright (C) 2016-2023 by + * Copyright (C) 2016-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/internal/services/svmm.h b/vendor/freetype/include/freetype/internal/services/svmm.h index 7e76ab8324..5288fadf37 100644 --- a/vendor/freetype/include/freetype/internal/services/svmm.h +++ b/vendor/freetype/include/freetype/internal/services/svmm.h @@ -4,7 +4,7 @@ * * The FreeType Multiple Masters and GX var services (specification). * - * Copyright (C) 2003-2023 by + * Copyright (C) 2003-2024 by * David Turner, Robert Wilhelm, Werner Lemberg, and Dominik Röttsches. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/internal/services/svotval.h b/vendor/freetype/include/freetype/internal/services/svotval.h index a4683cd5fb..7aea7ec11f 100644 --- a/vendor/freetype/include/freetype/internal/services/svotval.h +++ b/vendor/freetype/include/freetype/internal/services/svotval.h @@ -4,7 +4,7 @@ * * The FreeType OpenType validation service (specification). * - * Copyright (C) 2004-2023 by + * Copyright (C) 2004-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/internal/services/svpfr.h b/vendor/freetype/include/freetype/internal/services/svpfr.h index fd189c7de7..b2fac6d086 100644 --- a/vendor/freetype/include/freetype/internal/services/svpfr.h +++ b/vendor/freetype/include/freetype/internal/services/svpfr.h @@ -4,7 +4,7 @@ * * Internal PFR service functions (specification). * - * Copyright (C) 2003-2023 by + * Copyright (C) 2003-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/internal/services/svpostnm.h b/vendor/freetype/include/freetype/internal/services/svpostnm.h index 2b8f6dfecf..d19f3adc6d 100644 --- a/vendor/freetype/include/freetype/internal/services/svpostnm.h +++ b/vendor/freetype/include/freetype/internal/services/svpostnm.h @@ -4,7 +4,7 @@ * * The FreeType PostScript name services (specification). * - * Copyright (C) 2003-2023 by + * Copyright (C) 2003-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/internal/services/svprop.h b/vendor/freetype/include/freetype/internal/services/svprop.h index 932ce32e03..ba39c0dd4d 100644 --- a/vendor/freetype/include/freetype/internal/services/svprop.h +++ b/vendor/freetype/include/freetype/internal/services/svprop.h @@ -4,7 +4,7 @@ * * The FreeType property service (specification). * - * Copyright (C) 2012-2023 by + * Copyright (C) 2012-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/internal/services/svpscmap.h b/vendor/freetype/include/freetype/internal/services/svpscmap.h index 6e599f3aab..d4908ee41a 100644 --- a/vendor/freetype/include/freetype/internal/services/svpscmap.h +++ b/vendor/freetype/include/freetype/internal/services/svpscmap.h @@ -4,7 +4,7 @@ * * The FreeType PostScript charmap service (specification). * - * Copyright (C) 2003-2023 by + * Copyright (C) 2003-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/internal/services/svpsinfo.h b/vendor/freetype/include/freetype/internal/services/svpsinfo.h index 09c4cdccc5..2aadcdd02a 100644 --- a/vendor/freetype/include/freetype/internal/services/svpsinfo.h +++ b/vendor/freetype/include/freetype/internal/services/svpsinfo.h @@ -4,7 +4,7 @@ * * The FreeType PostScript info service (specification). * - * Copyright (C) 2003-2023 by + * Copyright (C) 2003-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/internal/services/svsfnt.h b/vendor/freetype/include/freetype/internal/services/svsfnt.h index f98df2ef5f..9e0f4ff202 100644 --- a/vendor/freetype/include/freetype/internal/services/svsfnt.h +++ b/vendor/freetype/include/freetype/internal/services/svsfnt.h @@ -4,7 +4,7 @@ * * The FreeType SFNT table loading service (specification). * - * Copyright (C) 2003-2023 by + * Copyright (C) 2003-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/internal/services/svttcmap.h b/vendor/freetype/include/freetype/internal/services/svttcmap.h index 5f9eb02d66..250886bcc5 100644 --- a/vendor/freetype/include/freetype/internal/services/svttcmap.h +++ b/vendor/freetype/include/freetype/internal/services/svttcmap.h @@ -4,7 +4,7 @@ * * The FreeType TrueType/sfnt cmap extra information service. * - * Copyright (C) 2003-2023 by + * Copyright (C) 2003-2024 by * Masatake YAMATO, Redhat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/vendor/freetype/include/freetype/internal/services/svtteng.h b/vendor/freetype/include/freetype/internal/services/svtteng.h index ad577cb290..14967529a9 100644 --- a/vendor/freetype/include/freetype/internal/services/svtteng.h +++ b/vendor/freetype/include/freetype/internal/services/svtteng.h @@ -4,7 +4,7 @@ * * The FreeType TrueType engine query service (specification). * - * Copyright (C) 2006-2023 by + * Copyright (C) 2006-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/internal/services/svttglyf.h b/vendor/freetype/include/freetype/internal/services/svttglyf.h index ca6fff7444..f190b3985d 100644 --- a/vendor/freetype/include/freetype/internal/services/svttglyf.h +++ b/vendor/freetype/include/freetype/internal/services/svttglyf.h @@ -4,7 +4,7 @@ * * The FreeType TrueType glyph service. * - * Copyright (C) 2007-2023 by + * Copyright (C) 2007-2024 by * David Turner. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/internal/services/svwinfnt.h b/vendor/freetype/include/freetype/internal/services/svwinfnt.h index 002923f8c9..49f3fb7f77 100644 --- a/vendor/freetype/include/freetype/internal/services/svwinfnt.h +++ b/vendor/freetype/include/freetype/internal/services/svwinfnt.h @@ -4,7 +4,7 @@ * * The FreeType Windows FNT/FONT service (specification). * - * Copyright (C) 2003-2023 by + * Copyright (C) 2003-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/internal/sfnt.h b/vendor/freetype/include/freetype/internal/sfnt.h index a2d4e15baa..35e4e73af0 100644 --- a/vendor/freetype/include/freetype/internal/sfnt.h +++ b/vendor/freetype/include/freetype/internal/sfnt.h @@ -4,7 +4,7 @@ * * High-level 'sfnt' driver interface (specification). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -924,6 +924,7 @@ FT_BEGIN_HEADER /* this field was called `load_kerning' up to version 2.1.10 */ TT_Load_Table_Func load_kern; + TT_Load_Table_Func load_gpos; TT_Load_Table_Func load_gasp; TT_Load_Table_Func load_pclt; @@ -944,6 +945,8 @@ FT_BEGIN_HEADER /* new elements introduced after version 2.1.10 */ + TT_Face_GetKerningFunc get_gpos_kerning; + /* load the font directory, i.e., the offset table and */ /* the table directory */ TT_Load_Table_Func load_font_dir; @@ -1002,6 +1005,7 @@ FT_BEGIN_HEADER load_name_, \ free_name_, \ load_kern_, \ + load_gpos_, \ load_gasp_, \ load_pclt_, \ load_bhed_, \ @@ -1009,6 +1013,7 @@ FT_BEGIN_HEADER get_psname_, \ free_psnames_, \ get_kerning_, \ + get_gpos_kerning_, \ load_font_dir_, \ load_hmtx_, \ load_eblc_, \ @@ -1050,6 +1055,7 @@ FT_BEGIN_HEADER load_name_, \ free_name_, \ load_kern_, \ + load_gpos_, \ load_gasp_, \ load_pclt_, \ load_bhed_, \ @@ -1057,6 +1063,7 @@ FT_BEGIN_HEADER get_psname_, \ free_psnames_, \ get_kerning_, \ + get_gpos_kerning_, \ load_font_dir_, \ load_hmtx_, \ load_eblc_, \ diff --git a/vendor/freetype/include/freetype/internal/svginterface.h b/vendor/freetype/include/freetype/internal/svginterface.h index f464b2c058..68c99efb10 100644 --- a/vendor/freetype/include/freetype/internal/svginterface.h +++ b/vendor/freetype/include/freetype/internal/svginterface.h @@ -4,7 +4,7 @@ * * Interface of ot-svg module (specification only). * - * Copyright (C) 2022-2023 by + * Copyright (C) 2022-2024 by * David Turner, Robert Wilhelm, Werner Lemberg, and Moazin Khatti. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/internal/t1types.h b/vendor/freetype/include/freetype/internal/t1types.h index b9c94398fd..1821ae5cc8 100644 --- a/vendor/freetype/include/freetype/internal/t1types.h +++ b/vendor/freetype/include/freetype/internal/t1types.h @@ -5,7 +5,7 @@ * Basic Type1/Type2 type definitions and interface (specification * only). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -21,7 +21,7 @@ #define T1TYPES_H_ -#include +#include #include #include #include @@ -137,6 +137,54 @@ FT_BEGIN_HEADER } CID_SubrsRec, *CID_Subrs; + /* this structure is used to store the BlendDesignMap entry for an axis */ + typedef struct PS_DesignMap_ + { + FT_Byte num_points; + FT_Long* design_points; + FT_Fixed* blend_points; + + } PS_DesignMapRec, *PS_DesignMap; + + /* backward compatible definition */ + typedef PS_DesignMapRec T1_DesignMap; + + + typedef struct PS_BlendRec_ + { + FT_UInt num_designs; + FT_UInt num_axis; + + FT_String* axis_names[T1_MAX_MM_AXIS]; + FT_Fixed* design_pos[T1_MAX_MM_DESIGNS]; + PS_DesignMapRec design_map[T1_MAX_MM_AXIS]; + + FT_Fixed* weight_vector; + FT_Fixed* default_weight_vector; + + PS_FontInfo font_infos[T1_MAX_MM_DESIGNS + 1]; + PS_Private privates [T1_MAX_MM_DESIGNS + 1]; + + FT_ULong blend_bitflags; + + FT_BBox* bboxes [T1_MAX_MM_DESIGNS + 1]; + + /* since 2.3.0 */ + + /* undocumented, optional: the default design instance; */ + /* corresponds to default_weight_vector -- */ + /* num_default_design_vector == 0 means it is not present */ + /* in the font and associated metrics files */ + FT_UInt default_design_vector[T1_MAX_MM_DESIGNS]; + FT_UInt num_default_design_vector; + + } PS_BlendRec, *PS_Blend; + + + /* backward compatible definition */ + typedef PS_BlendRec T1_Blend; + + /*************************************************************************/ /*************************************************************************/ /*************************************************************************/ diff --git a/vendor/freetype/include/freetype/internal/tttypes.h b/vendor/freetype/include/freetype/internal/tttypes.h index b9788c7831..7053e656a7 100644 --- a/vendor/freetype/include/freetype/internal/tttypes.h +++ b/vendor/freetype/include/freetype/internal/tttypes.h @@ -5,7 +5,7 @@ * Basic SFNT/TrueType type definitions and interface (specification * only). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -24,6 +24,7 @@ #include #include #include +#include "freetype/fttypes.h" #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT #include @@ -1581,6 +1582,11 @@ FT_BEGIN_HEADER FT_UInt32 kern_avail_bits; FT_UInt32 kern_order_bits; +#ifdef TT_CONFIG_OPTION_GPOS_KERNING + FT_Byte* gpos_table; + FT_Bool gpos_kerning_available; +#endif + #ifdef TT_CONFIG_OPTION_BDF TT_BDFRec bdf; #endif /* TT_CONFIG_OPTION_BDF */ @@ -1649,9 +1655,9 @@ FT_BEGIN_HEADER { FT_Memory memory; FT_UShort max_points; - FT_Short max_contours; + FT_UShort max_contours; FT_UShort n_points; /* number of points in zone */ - FT_Short n_contours; /* number of contours */ + FT_UShort n_contours; /* number of contours */ FT_Vector* org; /* original point coordinates */ FT_Vector* cur; /* current point coordinates */ diff --git a/vendor/freetype/include/freetype/internal/wofftypes.h b/vendor/freetype/include/freetype/internal/wofftypes.h index 0c1d8eeaf8..4a169d12f5 100644 --- a/vendor/freetype/include/freetype/internal/wofftypes.h +++ b/vendor/freetype/include/freetype/internal/wofftypes.h @@ -5,7 +5,7 @@ * Basic WOFF/WOFF2 type definitions and interface (specification * only). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/otsvg.h b/vendor/freetype/include/freetype/otsvg.h index bfe9a6ab74..9d356938cc 100644 --- a/vendor/freetype/include/freetype/otsvg.h +++ b/vendor/freetype/include/freetype/otsvg.h @@ -4,7 +4,7 @@ * * Interface for OT-SVG support related things (specification). * - * Copyright (C) 2022-2023 by + * Copyright (C) 2022-2024 by * David Turner, Robert Wilhelm, Werner Lemberg, and Moazin Khatti. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/t1tables.h b/vendor/freetype/include/freetype/t1tables.h index 1aecfbbd90..fbd558aa34 100644 --- a/vendor/freetype/include/freetype/t1tables.h +++ b/vendor/freetype/include/freetype/t1tables.h @@ -5,7 +5,7 @@ * Basic Type 1/Type 2 tables definitions and interface (specification * only). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -269,64 +269,6 @@ FT_BEGIN_HEADER /* */ - /* maximum number of Multiple Masters designs, as defined in the spec */ -#define T1_MAX_MM_DESIGNS 16 - - /* maximum number of Multiple Masters axes, as defined in the spec */ -#define T1_MAX_MM_AXIS 4 - - /* maximum number of elements in a design map */ -#define T1_MAX_MM_MAP_POINTS 20 - - - /* this structure is used to store the BlendDesignMap entry for an axis */ - typedef struct PS_DesignMap_ - { - FT_Byte num_points; - FT_Long* design_points; - FT_Fixed* blend_points; - - } PS_DesignMapRec, *PS_DesignMap; - - /* backward compatible definition */ - typedef PS_DesignMapRec T1_DesignMap; - - - typedef struct PS_BlendRec_ - { - FT_UInt num_designs; - FT_UInt num_axis; - - FT_String* axis_names[T1_MAX_MM_AXIS]; - FT_Fixed* design_pos[T1_MAX_MM_DESIGNS]; - PS_DesignMapRec design_map[T1_MAX_MM_AXIS]; - - FT_Fixed* weight_vector; - FT_Fixed* default_weight_vector; - - PS_FontInfo font_infos[T1_MAX_MM_DESIGNS + 1]; - PS_Private privates [T1_MAX_MM_DESIGNS + 1]; - - FT_ULong blend_bitflags; - - FT_BBox* bboxes [T1_MAX_MM_DESIGNS + 1]; - - /* since 2.3.0 */ - - /* undocumented, optional: the default design instance; */ - /* corresponds to default_weight_vector -- */ - /* num_default_design_vector == 0 means it is not present */ - /* in the font and associated metrics files */ - FT_UInt default_design_vector[T1_MAX_MM_DESIGNS]; - FT_UInt num_default_design_vector; - - } PS_BlendRec, *PS_Blend; - - - /* backward compatible definition */ - typedef PS_BlendRec T1_Blend; - - /************************************************************************** * * @struct: diff --git a/vendor/freetype/include/freetype/ttnameid.h b/vendor/freetype/include/freetype/ttnameid.h index e31c68b9ba..d5d470e380 100644 --- a/vendor/freetype/include/freetype/ttnameid.h +++ b/vendor/freetype/include/freetype/ttnameid.h @@ -4,7 +4,7 @@ * * TrueType name ID definitions (specification only). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/tttables.h b/vendor/freetype/include/freetype/tttables.h index a9f60e7620..111f218020 100644 --- a/vendor/freetype/include/freetype/tttables.h +++ b/vendor/freetype/include/freetype/tttables.h @@ -5,7 +5,7 @@ * Basic SFNT/TrueType tables definitions and interface * (specification only). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/freetype/tttags.h b/vendor/freetype/include/freetype/tttags.h index 9bf4fca23f..da0af5d3f2 100644 --- a/vendor/freetype/include/freetype/tttags.h +++ b/vendor/freetype/include/freetype/tttags.h @@ -4,7 +4,7 @@ * * Tags for TrueType and OpenType tables (specification only). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/include/ft2build.h b/vendor/freetype/include/ft2build.h index 58491ceea1..d3d7685039 100644 --- a/vendor/freetype/include/ft2build.h +++ b/vendor/freetype/include/ft2build.h @@ -4,7 +4,7 @@ * * FreeType 2 build and setup macros. * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/premake5.lua b/vendor/freetype/premake5.lua index ead564f67d..c5a9c828b0 100644 --- a/vendor/freetype/premake5.lua +++ b/vendor/freetype/premake5.lua @@ -38,7 +38,6 @@ project "freetype" "src/cache/ftcache.c", "src/cff/cff.c", "src/cid/type1cid.c", - "src/dlg/dlg.c", "src/gxvalid/gxvalid.c", "src/gzip/ftgzip.c", "src/lzw/ftlzw.c", diff --git a/vendor/freetype/src/autofit/afblue.c b/vendor/freetype/src/autofit/afblue.c index d7655b9b99..ea83969cdc 100644 --- a/vendor/freetype/src/autofit/afblue.c +++ b/vendor/freetype/src/autofit/afblue.c @@ -7,7 +7,7 @@ * * Auto-fitter data for blue strings (body). * - * Copyright (C) 2013-2023 by + * Copyright (C) 2013-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/autofit/afblue.cin b/vendor/freetype/src/autofit/afblue.cin index d561c5093b..d2270fac74 100644 --- a/vendor/freetype/src/autofit/afblue.cin +++ b/vendor/freetype/src/autofit/afblue.cin @@ -4,7 +4,7 @@ * * Auto-fitter data for blue strings (body). * - * Copyright (C) 2013-2023 by + * Copyright (C) 2013-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/autofit/afblue.dat b/vendor/freetype/src/autofit/afblue.dat index 8299baa259..9f1ea9a0b8 100644 --- a/vendor/freetype/src/autofit/afblue.dat +++ b/vendor/freetype/src/autofit/afblue.dat @@ -1,1121 +1,1121 @@ -// afblue.dat -// -// Auto-fitter data for blue strings. -// -// Copyright (C) 2013-2023 by -// David Turner, Robert Wilhelm, and Werner Lemberg. -// -// This file is part of the FreeType project, and may only be used, -// modified, and distributed under the terms of the FreeType project -// license, LICENSE.TXT. By continuing to use, modify, or distribute -// this file you indicate that you have read the license and -// understand and accept it fully. - - -// This file contains data specific to blue zones. It gets processed by -// a script to simulate `jagged arrays', with enumeration values holding -// offsets into the arrays. -// -// The format of the file is rather simple: A section starts with three -// labels separated by whitespace and followed by a colon (everything in a -// single line); the first label gives the name of the enumeration template, -// the second the name of the array template, and the third the name of the -// `maximum' template. The script then fills the corresponding templates -// (indicated by `@' characters around the name). -// -// A section contains one or more data records. Each data record consists -// of two or more lines. The first line holds the enumeration name, and the -// remaining lines the corresponding array data. -// -// There are two possible representations for array data. -// -// - A string of characters or character clusters (for example, representing -// Aksharas, Devanagari syllables) in UTF-8 encoding enclosed in double -// quotes, using C syntax, where the elements are separated by spaces. -// There can be only one string per line, thus the starting and ending -// double quote must be the first and last character in the line, -// respectively, ignoring whitespace before and after the string. If -// there are multiple strings (in multiple lines), they are concatenated -// to a single string. In the output, a string gets represented as a -// series of singles bytes, followed by a zero byte. The enumeration -// values simply hold byte offsets to the start of the corresponding -// strings. -// -// For strings, the `maximum' template holds the maximum number of -// non-space characters in all strings. -// -// - Data blocks enclosed in balanced braces, which get copied verbatim and -// which can span multiple lines. The opening brace of a block must be -// the first character of a line (ignoring whitespace), and the closing -// brace the last (ignoring whitespace also). The script appends a comma -// character after each block and counts the number of blocks to set the -// enumeration values. -// -// For data blocks, the `maximum' template holds the maximum number of -// array elements. -// -// A section can contain either strings only or data blocks only. -// -// A comment line starts with `//'; it gets removed. A preprocessor -// directive line (using the standard syntax of `cpp') starts with `#' and -// gets copied verbatim to both the enumeration and the array. Whitespace -// outside of a string is insignificant. -// -// Preprocessor directives are ignored while the script computes maximum -// values; this essentially means that the maximum values can easily be too -// large. Given that the purpose of those values is to create local -// fixed-size arrays at compile time for further processing of the blue zone -// data, this isn't a problem. Note the final zero byte of a string is not -// counted. Note also that the count holds the number of UTF-8 encoded -// characters, not bytes. - - -// The blue zone string data, to be used in the blue stringsets below. - -AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN: - - AF_BLUE_STRING_ADLAM_CAPITAL_TOP - "𞤌 𞤅 𞤈 𞤏 𞤔 𞤚" - AF_BLUE_STRING_ADLAM_CAPITAL_BOTTOM - "𞤂 𞤖" - AF_BLUE_STRING_ADLAM_SMALL_TOP - "𞤬 𞤮 𞤻 𞤼 𞤾" - AF_BLUE_STRING_ADLAM_SMALL_BOTTOM - "𞤤 𞤨 𞤩 𞤭 𞤴 𞤸 𞤺 𞥀" - - AF_BLUE_STRING_ARABIC_TOP - "ا إ ل ك ط ظ" - AF_BLUE_STRING_ARABIC_BOTTOM - "ت ث ط ظ ك" - // We don't necessarily have access to medial forms via Unicode in case - // Arabic presentational forms are missing. The only character that is - // guaranteed to have the same vertical position with joining (that is, - // non-isolated) forms is U+0640, ARABIC TATWEEL, which must join both - // round and flat curves. - AF_BLUE_STRING_ARABIC_JOIN - "ـ" - - AF_BLUE_STRING_ARMENIAN_CAPITAL_TOP - "Ա Մ Ւ Ս Բ Գ Դ Օ" - AF_BLUE_STRING_ARMENIAN_CAPITAL_BOTTOM - "Ւ Ո Դ Ճ Շ Ս Տ Օ" - AF_BLUE_STRING_ARMENIAN_SMALL_ASCENDER - "ե է ի մ վ ֆ ճ" - AF_BLUE_STRING_ARMENIAN_SMALL_TOP - "ա յ ւ ս գ շ ր օ" - AF_BLUE_STRING_ARMENIAN_SMALL_BOTTOM - "հ ո ճ ա ե ծ ս օ" - AF_BLUE_STRING_ARMENIAN_SMALL_DESCENDER - "բ ը ի լ ղ պ փ ց" - - AF_BLUE_STRING_AVESTAN_TOP - "𐬀 𐬁 𐬐 𐬛" - AF_BLUE_STRING_AVESTAN_BOTTOM - "𐬀 𐬁" - - AF_BLUE_STRING_BAMUM_TOP - "ꚧ ꚨ ꛛ ꛉ ꛁ ꛈ ꛫ ꛯ" - AF_BLUE_STRING_BAMUM_BOTTOM - "ꚭ ꚳ ꚶ ꛬ ꚢ ꚽ ꛯ ꛲" - - AF_BLUE_STRING_BENGALI_BASE - "অ ড ত ন ব ভ ল ক" - AF_BLUE_STRING_BENGALI_TOP - "ই ট ঠ ি ী ৈ ৗ" - AF_BLUE_STRING_BENGALI_HEAD - "ও এ ড ত ন ব ল ক" - - AF_BLUE_STRING_BUHID_TOP - "ᝐ ᝈ" - AF_BLUE_STRING_BUHID_LARGE - "ᝅ ᝊ ᝎ" - AF_BLUE_STRING_BUHID_SMALL - "ᝂ ᝃ ᝉ ᝌ" - AF_BLUE_STRING_BUHID_BOTTOM - "ᝀ ᝃ ᝆ ᝉ ᝋ ᝏ ᝑ" - - AF_BLUE_STRING_CANADIAN_SYLLABICS_TOP - "ᗜ ᖴ ᐁ ᒣ ᑫ ᑎ ᔑ ᗰ" - AF_BLUE_STRING_CANADIAN_SYLLABICS_BOTTOM - "ᗶ ᖵ ᒧ ᐃ ᑌ ᒍ ᔑ ᗢ" - AF_BLUE_STRING_CANADIAN_SYLLABICS_SMALL_TOP - "ᓓ ᓕ ᓀ ᓂ ᓄ ᕄ ᕆ ᘣ" - AF_BLUE_STRING_CANADIAN_SYLLABICS_SMALL_BOTTOM - "ᕃ ᓂ ᓀ ᕂ ᓗ ᓚ ᕆ ᘣ" - AF_BLUE_STRING_CANADIAN_SYLLABICS_SUPS_TOP - "ᐪ ᙆ ᣘ ᐢ ᒾ ᣗ ᔆ" - AF_BLUE_STRING_CANADIAN_SYLLABICS_SUPS_BOTTOM - "ᙆ ᗮ ᒻ ᐞ ᔆ ᒡ ᒢ ᓑ" - - AF_BLUE_STRING_CARIAN_TOP - "𐊧 𐊫 𐊬 𐊭 𐊱 𐊺 𐊼 𐊿" - AF_BLUE_STRING_CARIAN_BOTTOM - "𐊣 𐊧 𐊷 𐋀 𐊫 𐊸 𐋉" - - AF_BLUE_STRING_CHAKMA_TOP - "𑄃 𑄅 𑄉 𑄙 𑄗" - AF_BLUE_STRING_CHAKMA_BOTTOM - "𑄅 𑄛 𑄝 𑄗 𑄓" - AF_BLUE_STRING_CHAKMA_DESCENDER - "𑄖𑄳𑄢 𑄘𑄳𑄢 𑄙𑄳𑄢 𑄤𑄳𑄢 𑄥𑄳𑄢" - - AF_BLUE_STRING_CHEROKEE_CAPITAL - "Ꮖ Ꮋ Ꭼ Ꮓ Ꭴ Ꮳ Ꭶ Ꮥ" - AF_BLUE_STRING_CHEROKEE_SMALL_ASCENDER - "ꮒ ꮤ ꮶ ꭴ ꭾ ꮗ ꮝ ꮿ" - AF_BLUE_STRING_CHEROKEE_SMALL - "ꮖ ꭼ ꮓ ꮠ ꮳ ꭶ ꮥ ꮻ" - AF_BLUE_STRING_CHEROKEE_SMALL_DESCENDER - "ᏸ ꮐ ꭹ ꭻ" - - AF_BLUE_STRING_COPTIC_CAPITAL_TOP - "Ⲍ Ⲏ Ⲡ Ⳟ Ⲟ Ⲑ Ⲥ Ⳋ" - AF_BLUE_STRING_COPTIC_CAPITAL_BOTTOM - "Ⳑ Ⳙ Ⳟ Ⲏ Ⲟ Ⲑ Ⳝ Ⲱ" - AF_BLUE_STRING_COPTIC_SMALL_TOP - "ⲍ ⲏ ⲡ ⳟ ⲟ ⲑ ⲥ ⳋ" - AF_BLUE_STRING_COPTIC_SMALL_BOTTOM - "ⳑ ⳙ ⳟ ⲏ ⲟ ⲑ ⳝ Ⳓ" - - AF_BLUE_STRING_CYPRIOT_TOP - "𐠍 𐠙 𐠳 𐠱 𐠅 𐠓 𐠣 𐠦" - AF_BLUE_STRING_CYPRIOT_BOTTOM - "𐠃 𐠊 𐠛 𐠣 𐠳 𐠵 𐠐" - AF_BLUE_STRING_CYPRIOT_SMALL - "𐠈 𐠏 𐠖" - - AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP - "Б В Е П З О С Э" - AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM - "Б В Е Ш З О С Э" - AF_BLUE_STRING_CYRILLIC_SMALL - "х п н ш е з о с" - AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER - "р у ф" - - AF_BLUE_STRING_DESERET_CAPITAL_TOP - "𐐂 𐐄 𐐋 𐐗 𐐑" - AF_BLUE_STRING_DESERET_CAPITAL_BOTTOM - "𐐀 𐐂 𐐄 𐐗 𐐛" - AF_BLUE_STRING_DESERET_SMALL_TOP - "𐐪 𐐬 𐐳 𐐿 𐐹" - AF_BLUE_STRING_DESERET_SMALL_BOTTOM - "𐐨 𐐪 𐐬 𐐿 𐑃" - - AF_BLUE_STRING_DEVANAGARI_BASE - "क न म उ छ ट ठ ड" - AF_BLUE_STRING_DEVANAGARI_TOP - "ई ऐ ओ औ ि ी ो ौ" - // note that some fonts have extreme variation in the height of the - // round head elements; for this reason we also define the `base' - // blue zone, which must be always present - AF_BLUE_STRING_DEVANAGARI_HEAD - "क म अ आ थ ध भ श" - AF_BLUE_STRING_DEVANAGARI_BOTTOM - "ु ृ" - - AF_BLUE_STRING_ETHIOPIC_TOP - "ሀ ሃ ዘ ፐ ማ በ ዋ ዐ" - AF_BLUE_STRING_ETHIOPIC_BOTTOM - "ለ ሐ በ ዘ ሀ ሪ ዐ ጨ" - - AF_BLUE_STRING_GEORGIAN_MKHEDRULI_TOP - "გ დ ე ვ თ ი ო ღ" - AF_BLUE_STRING_GEORGIAN_MKHEDRULI_BOTTOM - "ა ზ მ ს შ ძ ხ პ" - AF_BLUE_STRING_GEORGIAN_MKHEDRULI_ASCENDER - "ს ხ ქ ზ მ შ ჩ წ" - AF_BLUE_STRING_GEORGIAN_MKHEDRULI_DESCENDER - "ე ვ ჟ ტ უ ფ ქ ყ" - - AF_BLUE_STRING_GEORGIAN_ASOMTAVRULI_TOP - "Ⴑ Ⴇ Ⴙ Ⴜ Ⴄ Ⴅ Ⴓ Ⴚ" - AF_BLUE_STRING_GEORGIAN_ASOMTAVRULI_BOTTOM - "Ⴄ Ⴅ Ⴇ Ⴈ Ⴆ Ⴑ Ⴊ Ⴋ" - - AF_BLUE_STRING_GEORGIAN_NUSKHURI_TOP - "ⴁ ⴗ ⴂ ⴄ ⴅ ⴇ ⴔ ⴖ" - AF_BLUE_STRING_GEORGIAN_NUSKHURI_BOTTOM - "ⴈ ⴌ ⴖ ⴎ ⴃ ⴆ ⴋ ⴢ" - AF_BLUE_STRING_GEORGIAN_NUSKHURI_ASCENDER - "ⴐ ⴑ ⴓ ⴕ ⴙ ⴛ ⴡ ⴣ" - AF_BLUE_STRING_GEORGIAN_NUSKHURI_DESCENDER - "ⴄ ⴅ ⴔ ⴕ ⴁ ⴂ ⴘ ⴝ" - - AF_BLUE_STRING_GEORGIAN_MTAVRULI_TOP - "Ნ Ჟ Ჳ Ჸ Გ Ე Ო Ჴ" - AF_BLUE_STRING_GEORGIAN_MTAVRULI_BOTTOM - "Ი Ჲ Ო Ჩ Მ Შ Ჯ Ჽ" - - AF_BLUE_STRING_GLAGOLITIC_CAPITAL_TOP - "Ⰵ Ⱄ Ⱚ Ⰴ Ⰲ Ⰺ Ⱛ Ⰻ" - AF_BLUE_STRING_GLAGOLITIC_CAPITAL_BOTTOM - "Ⰵ Ⰴ Ⰲ Ⱚ Ⱎ Ⱑ Ⰺ Ⱄ" - AF_BLUE_STRING_GLAGOLITIC_SMALL_TOP - "ⰵ ⱄ ⱚ ⰴ ⰲ ⰺ ⱛ ⰻ" - AF_BLUE_STRING_GLAGOLITIC_SMALL_BOTTOM - "ⰵ ⰴ ⰲ ⱚ ⱎ ⱑ ⰺ ⱄ" - - AF_BLUE_STRING_GOTHIC_TOP - "𐌲 𐌶 𐍀 𐍄 𐌴 𐍃 𐍈 𐌾" - AF_BLUE_STRING_GOTHIC_BOTTOM - "𐌶 𐌴 𐍃 𐍈" - - AF_BLUE_STRING_GREEK_CAPITAL_TOP - "Γ Β Ε Ζ Θ Ο Ω" - AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM - "Β Δ Ζ Ξ Θ Ο" - AF_BLUE_STRING_GREEK_SMALL_BETA_TOP - "β θ δ ζ λ ξ" - AF_BLUE_STRING_GREEK_SMALL - "α ε ι ο π σ τ ω" - AF_BLUE_STRING_GREEK_SMALL_DESCENDER - "β γ η μ ρ φ χ ψ" - - AF_BLUE_STRING_GUJARATI_TOP - "ત ન ઋ ઌ છ ટ ર ૦" - AF_BLUE_STRING_GUJARATI_BOTTOM - "ખ ગ ઘ ઞ ઇ ઈ ઠ જ" - AF_BLUE_STRING_GUJARATI_ASCENDER - "ઈ ઊ િ ી લી શ્ચિ જિ સી" - AF_BLUE_STRING_GUJARATI_DESCENDER - "ુ ૃ ૄ ખુ છૃ છૄ" - AF_BLUE_STRING_GUJARATI_DIGIT_TOP - "૦ ૧ ૨ ૩ ૭" - - AF_BLUE_STRING_GURMUKHI_BASE - "ਕ ਗ ਙ ਚ ਜ ਤ ਧ ਸ" - AF_BLUE_STRING_GURMUKHI_HEAD - "ਕ ਗ ਙ ਚ ਜ ਤ ਧ ਸ" - AF_BLUE_STRING_GURMUKHI_TOP - "ਇ ਈ ਉ ਏ ਓ ੳ ਿ ੀ" - AF_BLUE_STRING_GURMUKHI_BOTTOM - "ਅ ਏ ਓ ਗ ਜ ਠ ਰ ਸ" - AF_BLUE_STRING_GURMUKHI_DIGIT_TOP - "੦ ੧ ੨ ੩ ੭" - - AF_BLUE_STRING_HEBREW_TOP - "ב ד ה ח ך כ ם ס" - AF_BLUE_STRING_HEBREW_BOTTOM - "ב ט כ ם ס צ" - AF_BLUE_STRING_HEBREW_DESCENDER - "ק ך ן ף ץ" - - AF_BLUE_STRING_KANNADA_TOP - "ಇ ಊ ಐ ಣ ಸಾ ನಾ ದಾ ರಾ" - AF_BLUE_STRING_KANNADA_BOTTOM - "ಅ ಉ ಎ ಲ ೦ ೨ ೬ ೭" - - AF_BLUE_STRING_KAYAH_LI_TOP - "꤅ ꤏ ꤁ ꤋ ꤀ ꤍ" - AF_BLUE_STRING_KAYAH_LI_BOTTOM - "꤈ ꤘ ꤀ ꤍ ꤢ" - AF_BLUE_STRING_KAYAH_LI_ASCENDER - "ꤖ ꤡ" - AF_BLUE_STRING_KAYAH_LI_DESCENDER - "ꤑ ꤜ ꤞ" - AF_BLUE_STRING_KAYAH_LI_LARGE_DESCENDER - "ꤑ꤬ ꤜ꤭ ꤔ꤬" - - AF_BLUE_STRING_KHMER_TOP - "ខ ទ ន ឧ ឩ ា" - AF_BLUE_STRING_KHMER_SUBSCRIPT_TOP - "ក្ក ក្ខ ក្គ ក្ថ" - AF_BLUE_STRING_KHMER_BOTTOM - "ខ ឃ ច ឋ ប ម យ ឲ" - AF_BLUE_STRING_KHMER_DESCENDER - "ត្រ រៀ ឲ្យ អឿ" - AF_BLUE_STRING_KHMER_LARGE_DESCENDER - "ន្ត្រៃ ង្ខ្យ ក្បៀ ច្រៀ ន្តឿ ល្បឿ" - - AF_BLUE_STRING_KHMER_SYMBOLS_WAXING_TOP - "᧠ ᧡" - AF_BLUE_STRING_KHMER_SYMBOLS_WANING_BOTTOM - "᧶ ᧹" - - AF_BLUE_STRING_LAO_TOP - "າ ດ ອ ມ ລ ວ ຣ ງ" - AF_BLUE_STRING_LAO_BOTTOM - "າ ອ ບ ຍ ຣ ຮ ວ ຢ" - AF_BLUE_STRING_LAO_ASCENDER - "ປ ຢ ຟ ຝ" - AF_BLUE_STRING_LAO_LARGE_ASCENDER - "ໂ ໄ ໃ" - AF_BLUE_STRING_LAO_DESCENDER - "ງ ຊ ຖ ຽ ໆ ຯ" - - AF_BLUE_STRING_LATIN_CAPITAL_TOP - "T H E Z O C Q S" - AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM - "H E Z L O C U S" - AF_BLUE_STRING_LATIN_SMALL_F_TOP - "f i j k d b h" - AF_BLUE_STRING_LATIN_SMALL_TOP - "u v x z o e s c" - AF_BLUE_STRING_LATIN_SMALL_BOTTOM - "n r x z o e s c" - AF_BLUE_STRING_LATIN_SMALL_DESCENDER - "p q g j y" - - // we assume that both the subscript and superscript ranges - // don't contain oldstyle digits (actually, most fonts probably - // have digits only in those ranges) - AF_BLUE_STRING_LATIN_SUBS_CAPITAL_TOP - "₀ ₃ ₅ ₇ ₈" - AF_BLUE_STRING_LATIN_SUBS_CAPITAL_BOTTOM - "₀ ₁ ₂ ₃ ₈" - AF_BLUE_STRING_LATIN_SUBS_SMALL_F_TOP - "ᵢ ⱼ ₕ ₖ ₗ" - AF_BLUE_STRING_LATIN_SUBS_SMALL - "ₐ ₑ ₒ ₓ ₙ ₛ ᵥ ᵤ ᵣ" - AF_BLUE_STRING_LATIN_SUBS_SMALL_DESCENDER - "ᵦ ᵧ ᵨ ᵩ ₚ" - - AF_BLUE_STRING_LATIN_SUPS_CAPITAL_TOP - "⁰ ³ ⁵ ⁷ ᵀ ᴴ ᴱ ᴼ" - AF_BLUE_STRING_LATIN_SUPS_CAPITAL_BOTTOM - "⁰ ¹ ² ³ ᴱ ᴸ ᴼ ᵁ" - AF_BLUE_STRING_LATIN_SUPS_SMALL_F_TOP - "ᵇ ᵈ ᵏ ʰ ʲ ᶠ ⁱ" - AF_BLUE_STRING_LATIN_SUPS_SMALL - "ᵉ ᵒ ʳ ˢ ˣ ᶜ ᶻ" - AF_BLUE_STRING_LATIN_SUPS_SMALL_DESCENDER - "ᵖ ʸ ᵍ" - - AF_BLUE_STRING_LISU_TOP - "ꓡ ꓧ ꓱ ꓶ ꓩ ꓚ ꓵ ꓳ" - AF_BLUE_STRING_LISU_BOTTOM - "ꓕ ꓜ ꓞ ꓡ ꓛ ꓢ ꓳ ꓴ" - - AF_BLUE_STRING_MALAYALAM_TOP - "ഒ ട ഠ റ ച പ ച്ച പ്പ" - AF_BLUE_STRING_MALAYALAM_BOTTOM - "ട ഠ ധ ശ ഘ ച ഥ ല" - - AF_BLUE_STRING_MEDEFAIDRIN_CAPITAL_TOP - "𖹀 𖹁 𖹂 𖹃 𖹏 𖹚 𖹟" - AF_BLUE_STRING_MEDEFAIDRIN_CAPITAL_BOTTOM - "𖹀 𖹁 𖹂 𖹃 𖹏 𖹚 𖹒 𖹓" - AF_BLUE_STRING_MEDEFAIDRIN_SMALL_F_TOP - "𖹤 𖹬 𖹧 𖹴 𖹶 𖹾" - AF_BLUE_STRING_MEDEFAIDRIN_SMALL_TOP - "𖹠 𖹡 𖹢 𖹹 𖹳 𖹮" - AF_BLUE_STRING_MEDEFAIDRIN_SMALL_BOTTOM - "𖹠 𖹡 𖹢 𖹳 𖹭 𖹽" - AF_BLUE_STRING_MEDEFAIDRIN_SMALL_DESCENDER - "𖹥 𖹨 𖹩" - AF_BLUE_STRING_MEDEFAIDRIN_DIGIT_TOP - "𖺀 𖺅 𖺈 𖺄 𖺍" - - AF_BLUE_STRING_MONGOLIAN_TOP_BASE - "ᠳ ᠴ ᠶ ᠽ ᡂ ᡊ ‍ᡡ‍ ‍ᡳ‍" - AF_BLUE_STRING_MONGOLIAN_BOTTOM_BASE - "ᡃ" - - AF_BLUE_STRING_MYANMAR_TOP - "ခ ဂ င ဒ ဝ ၥ ၊ ။" - AF_BLUE_STRING_MYANMAR_BOTTOM - "င ဎ ဒ ပ ဗ ဝ ၊ ။" - AF_BLUE_STRING_MYANMAR_ASCENDER - "ဩ ြ ၍ ၏ ၆ ါ ိ" - AF_BLUE_STRING_MYANMAR_DESCENDER - "ဉ ည ဥ ဩ ဨ ၂ ၅ ၉" - - AF_BLUE_STRING_NKO_TOP - "ߐ ߉ ߒ ߟ ߖ ߜ ߠ ߥ" - AF_BLUE_STRING_NKO_BOTTOM - "߀ ߘ ߡ ߠ ߥ" - AF_BLUE_STRING_NKO_SMALL_TOP - "ߏ ߛ ߋ" - AF_BLUE_STRING_NKO_SMALL_BOTTOM - "ߎ ߏ ߛ ߋ" - - AF_BLUE_STRING_OL_CHIKI - "ᱛ ᱜ ᱝ ᱡ ᱢ ᱥ" - - AF_BLUE_STRING_OLD_TURKIC_TOP - "𐰗 𐰘 𐰧" - AF_BLUE_STRING_OLD_TURKIC_BOTTOM - "𐰉 𐰗 𐰦 𐰧" - - AF_BLUE_STRING_OSAGE_CAPITAL_TOP - "𐒾 𐓍 𐓒 𐓓 𐒻 𐓂 𐒵 𐓆" - AF_BLUE_STRING_OSAGE_CAPITAL_BOTTOM - "𐒰 𐓍 𐓂 𐒿 𐓎 𐒹" - AF_BLUE_STRING_OSAGE_CAPITAL_DESCENDER - "𐒼 𐒽 𐒾" - AF_BLUE_STRING_OSAGE_SMALL_TOP - "𐓵 𐓶 𐓺 𐓻 𐓝 𐓣 𐓪 𐓮" - AF_BLUE_STRING_OSAGE_SMALL_BOTTOM - "𐓘 𐓚 𐓣 𐓵 𐓡 𐓧 𐓪 𐓶" - AF_BLUE_STRING_OSAGE_SMALL_ASCENDER - "𐓤 𐓦 𐓸 𐓹 𐓛" - AF_BLUE_STRING_OSAGE_SMALL_DESCENDER - "𐓤 𐓥 𐓦" - - AF_BLUE_STRING_OSMANYA_TOP - "𐒆 𐒉 𐒐 𐒒 𐒘 𐒛 𐒠 𐒣" - AF_BLUE_STRING_OSMANYA_BOTTOM - "𐒀 𐒂 𐒆 𐒈 𐒊 𐒒 𐒠 𐒩" - - AF_BLUE_STRING_ROHINGYA_TOP - "𐴃 𐴀 𐴆 𐴖 𐴕" - AF_BLUE_STRING_ROHINGYA_BOTTOM - "𐴔 𐴖 𐴕 𐴑 𐴐" - AF_BLUE_STRING_ROHINGYA_JOIN - "ـ" - - AF_BLUE_STRING_SAURASHTRA_TOP - "ꢜ ꢞ ꢳ ꢂ ꢖ ꢒ ꢝ ꢛ" - AF_BLUE_STRING_SAURASHTRA_BOTTOM - "ꢂ ꢨ ꢺ ꢤ ꢎ" - - AF_BLUE_STRING_SHAVIAN_TOP - "𐑕 𐑙" - AF_BLUE_STRING_SHAVIAN_BOTTOM - "𐑔 𐑖 𐑗 𐑹 𐑻" - AF_BLUE_STRING_SHAVIAN_DESCENDER - "𐑟 𐑣" - AF_BLUE_STRING_SHAVIAN_SMALL_TOP - "𐑱 𐑲 𐑳 𐑴 𐑸 𐑺 𐑼" - AF_BLUE_STRING_SHAVIAN_SMALL_BOTTOM - "𐑴 𐑻 𐑹" - - AF_BLUE_STRING_SINHALA_TOP - "ඉ ක ඝ ඳ ප ය ල ෆ" - AF_BLUE_STRING_SINHALA_BOTTOM - "එ ඔ ඝ ජ ට ථ ධ ර" - AF_BLUE_STRING_SINHALA_DESCENDER - "ද ඳ උ ල තූ තු බු දු" - - AF_BLUE_STRING_SUNDANESE_TOP - "ᮋ ᮞ ᮮ ᮽ ᮰ ᮈ" - AF_BLUE_STRING_SUNDANESE_BOTTOM - "ᮄ ᮔ ᮕ ᮗ ᮰ ᮆ ᮈ ᮉ" - AF_BLUE_STRING_SUNDANESE_DESCENDER - "ᮼ ᳄" - - AF_BLUE_STRING_TAI_VIET_TOP - "ꪆ ꪔ ꪒ ꪖ ꪫ" - AF_BLUE_STRING_TAI_VIET_BOTTOM - "ꪉ ꪫ ꪮ" - - AF_BLUE_STRING_TAMIL_TOP - "உ ஒ ஓ ற ஈ க ங ச" - AF_BLUE_STRING_TAMIL_BOTTOM - "க ச ல ஶ உ ங ட ப" - - AF_BLUE_STRING_TELUGU_TOP - "ఇ ఌ ఙ ఞ ణ ఱ ౯" - AF_BLUE_STRING_TELUGU_BOTTOM - "అ క చ ర ఽ ౨ ౬" - - AF_BLUE_STRING_THAI_TOP - "บ เ แ อ ก า" - AF_BLUE_STRING_THAI_BOTTOM - "บ ป ษ ฯ อ ย ฮ" - AF_BLUE_STRING_THAI_ASCENDER - "ป ฝ ฟ" - AF_BLUE_STRING_THAI_LARGE_ASCENDER - "โ ใ ไ" - AF_BLUE_STRING_THAI_DESCENDER - "ฎ ฏ ฤ ฦ" - AF_BLUE_STRING_THAI_LARGE_DESCENDER - "ญ ฐ" - AF_BLUE_STRING_THAI_DIGIT_TOP - "๐ ๑ ๓" - - AF_BLUE_STRING_TIFINAGH - "ⵔ ⵙ ⵛ ⵞ ⴵ ⴼ ⴹ ⵎ" - - AF_BLUE_STRING_VAI_TOP - "ꗍ ꘖ ꘙ ꘜ ꖜ ꖝ ꔅ ꕢ" - AF_BLUE_STRING_VAI_BOTTOM - "ꗍ ꘖ ꘙ ꗞ ꔅ ꕢ ꖜ ꔆ" - - -#ifdef AF_CONFIG_OPTION_CJK - - AF_BLUE_STRING_CJK_TOP - "他 们 你 來 們 到 和 地" - " 对 對 就 席 我 时 時 會" - " 来 為 能 舰 說 说 这 這" - " 齊 |" - " 军 同 已 愿 既 星 是 景" - " 民 照 现 現 理 用 置 要" - " 軍 那 配 里 開 雷 露 面" - " 顾" - AF_BLUE_STRING_CJK_BOTTOM - "个 为 人 他 以 们 你 來" - " 個 們 到 和 大 对 對 就" - " 我 时 時 有 来 為 要 說" - " 说 |" - " 主 些 因 它 想 意 理 生" - " 當 看 着 置 者 自 著 裡" - " 过 还 进 進 過 道 還 里" - " 面" - -#ifdef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT - - AF_BLUE_STRING_CJK_LEFT - " 些 们 你 來 們 到 和 地" - " 她 将 將 就 年 得 情 最" - " 样 樣 理 能 說 说 这 這" - " 通 |" - " 即 吗 吧 听 呢 品 响 嗎" - " 师 師 收 断 斷 明 眼 間" - " 间 际 陈 限 除 陳 随 際" - " 隨" - AF_BLUE_STRING_CJK_RIGHT - "事 前 學 将 將 情 想 或" - " 政 斯 新 样 樣 民 沒 没" - " 然 特 现 現 球 第 經 谁" - " 起 |" - " 例 別 别 制 动 動 吗 嗎" - " 增 指 明 朝 期 构 物 确" - " 种 調 调 費 费 那 都 間" - " 间" - -#endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */ - -#endif /* AF_CONFIG_OPTION_CJK */ - - -// The blue zone stringsets, as used in the script styles, cf. `afstyles.h'. -// -// The AF_BLUE_PROPERTY_XXX flags are defined in `afblue.h'; here some -// explanations. -// -// A blue zone in general is defined by a reference and an overshoot line. -// During the hinting process, all coordinate values between those two lines -// are set equal to the reference value, provided that the blue zone is not -// wider than 0.75 pixels (otherwise the blue zone gets ignored). All -// entries must have `AF_BLUE_STRING_MAX' as the final line. -// -// During the glyph analysis, edges are sorted from bottom to top, and then -// sequentially checked, edge by edge, against the blue zones in the order -// given below. -// -// -// latin auto-hinter -// ----------------- -// -// Characters in a blue string are automatically classified as having a flat -// (reference) or a round (overshoot) extremum. The blue zone is then set -// up by the mean values of all flat extrema and all round extrema, -// respectively. Only horizontal blue zones (i.e., adjusting vertical -// coordinate values) are supported. -// -// Some scripts like Khmer need character composition to get all necessary -// blue zones, since Unicode only provides an abstract data model that -// doesn't represent all possible glyph shapes. For such character -// clusters, the HarfBuzz library is used to convert them into the -// corresponding glyphs. The largest glyph element (where `largest' can be -// either `largest ascender' or `largest descender') then defines the -// corresponding flat or round extremum. -// -// For the latin auto-hinter, the overshoot should be larger than the -// reference for top zones, and vice versa for bottom zones. -// -// LATIN_TOP -// Take the maximum flat and round coordinate values of the blue string -// characters for computing the blue zone's reference and overshoot -// values. -// -// If not set, take the minimum values. -// -// Mutually exclusive with `LATIN_SUB_TOP'. -// -// LATIN_SUB_TOP -// For all glyphs of a character cluster, compute the maximum flat -// and round coordinate values of each component, then take the -// smallest of the maximum values. The idea is to get the top of -// subscript glyphs, as used in Khmer, for example. Note that -// this mechanism doesn't work for ordinary ligatures. -// -// This flags indicates a secondary blue zone: It gets removed if -// there is a non-LATIN_SUB_TOP blue zone at the same coordinate -// value (after scaling). -// -// Mutually exclusive with `LATIN_TOP'. -// -// LATIN_NEUTRAL -// Ignore round extrema and define the blue zone with flat values only. -// Both top and bottom of contours can match. This is useful for -// scripts like Devanagari where vowel signs attach to the base -// character and are implemented as components of composite glyphs. -// -// If not set, both round and flat extrema are taken into account. -// Additionally, only the top or the bottom of a contour can match, -// depending on the LATIN_TOP flag. -// -// Neutral blue zones should always follow non-neutral blue zones. -// -// LATIN_X_HEIGHT -// Scale all glyphs vertically from the corresponding script to make the -// reference line of this blue zone align on the grid. The scaling -// takes place before all other blue zones get aligned to the grid. -// Only one blue character string of a script style can have this flag. -// -// LATIN_LONG -// Apply an additional constraint for blue zone values: Don't -// necessarily use the extremum as-is but a segment of the topmost (or -// bottommost) contour that is longer than a heuristic threshold, and -// which is not too far away vertically from the real extremum. This -// ensures that small bumps in the outline are ignored (for example, the -// `vertical serifs' found in many Hebrew glyph designs). -// -// The segment must be at least EM/25 font units long, and the distance -// to the extremum must be smaller than EM/4. -// -// -// cjk auto-hinter -// --------------- -// -// Characters in a blue string are *not* automatically classified. Instead, -// first come the characters used for the overshoot value, then the -// character `|', then the characters used for the reference value -// (everything separated by space characters). The blue zone is then set up -// by the mean values of all reference values and all overshoot values, -// respectively. Both horizontal and vertical blue zones (i.e., adjusting -// vertical and horizontal coordinate values, respectively) are supported. -// -// For the cjk auto-hinter, the overshoot should be smaller than the -// reference for top zones, and vice versa for bottom zones. -// -// CJK_TOP -// Take the maximum flat and round coordinate values of the blue string -// characters. If not set, take the minimum values. -// -// CJK_RIGHT -// A synonym for CJK_TOP. If CJK_HORIZ is set, this flag indicates the -// right blue zone, taking horizontal maximum values. -// -// CJK_HORIZ -// Define a blue zone for horizontal hinting (i.e., vertical blue -// zones). If not set, this is a blue zone for vertical hinting. - - -AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN: - - AF_BLUE_STRINGSET_ADLM - { AF_BLUE_STRING_ADLAM_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_ADLAM_CAPITAL_BOTTOM, 0 } - { AF_BLUE_STRING_ADLAM_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT } - { AF_BLUE_STRING_ADLAM_SMALL_BOTTOM, 0 } - { AF_BLUE_STRING_MAX, 0 } - - AF_BLUE_STRINGSET_ARAB - { AF_BLUE_STRING_ARABIC_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_ARABIC_BOTTOM, 0 } - { AF_BLUE_STRING_ARABIC_JOIN, AF_BLUE_PROPERTY_LATIN_NEUTRAL } - { AF_BLUE_STRING_MAX, 0 } - - AF_BLUE_STRINGSET_ARMN - { AF_BLUE_STRING_ARMENIAN_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_ARMENIAN_CAPITAL_BOTTOM, 0 } - { AF_BLUE_STRING_ARMENIAN_SMALL_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_ARMENIAN_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT } - { AF_BLUE_STRING_ARMENIAN_SMALL_BOTTOM, 0 } - { AF_BLUE_STRING_ARMENIAN_SMALL_DESCENDER, 0 } - { AF_BLUE_STRING_MAX, 0 } - - AF_BLUE_STRINGSET_AVST - { AF_BLUE_STRING_AVESTAN_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_AVESTAN_BOTTOM, 0 } - { AF_BLUE_STRING_MAX, 0 } - - AF_BLUE_STRINGSET_BAMU - { AF_BLUE_STRING_BAMUM_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_BAMUM_BOTTOM, 0 } - { AF_BLUE_STRING_MAX, 0 } - - AF_BLUE_STRINGSET_BENG - { AF_BLUE_STRING_BENGALI_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_BENGALI_HEAD, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_BENGALI_BASE, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_NEUTRAL | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT } - { AF_BLUE_STRING_BENGALI_BASE, 0 } - { AF_BLUE_STRING_MAX, 0 } - - AF_BLUE_STRINGSET_BUHD - { AF_BLUE_STRING_BUHID_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_BUHID_LARGE, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_BUHID_SMALL, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT } - { AF_BLUE_STRING_BUHID_BOTTOM, 0 } - { AF_BLUE_STRING_MAX, 0 } - - AF_BLUE_STRINGSET_CAKM - { AF_BLUE_STRING_CHAKMA_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_CHAKMA_BOTTOM, 0 } - { AF_BLUE_STRING_CHAKMA_DESCENDER, 0 } - { AF_BLUE_STRING_MAX, 0 } - - AF_BLUE_STRINGSET_CANS - { AF_BLUE_STRING_CANADIAN_SYLLABICS_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_CANADIAN_SYLLABICS_BOTTOM, 0 } - { AF_BLUE_STRING_CANADIAN_SYLLABICS_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT } - { AF_BLUE_STRING_CANADIAN_SYLLABICS_SMALL_BOTTOM, 0 } - { AF_BLUE_STRING_CANADIAN_SYLLABICS_SUPS_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_CANADIAN_SYLLABICS_SUPS_BOTTOM, 0 } - { AF_BLUE_STRING_MAX, 0 } - - AF_BLUE_STRINGSET_CARI - { AF_BLUE_STRING_CARIAN_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_CARIAN_BOTTOM, 0 } - { AF_BLUE_STRING_MAX, 0 } - - AF_BLUE_STRINGSET_CHER - { AF_BLUE_STRING_CHEROKEE_CAPITAL, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_CHEROKEE_CAPITAL, 0 } - { AF_BLUE_STRING_CHEROKEE_SMALL_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_CHEROKEE_SMALL, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT } - { AF_BLUE_STRING_CHEROKEE_SMALL, 0 } - { AF_BLUE_STRING_CHEROKEE_SMALL_DESCENDER, 0 } - { AF_BLUE_STRING_MAX, 0 } - - AF_BLUE_STRINGSET_COPT - { AF_BLUE_STRING_COPTIC_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_COPTIC_CAPITAL_BOTTOM, 0 } - { AF_BLUE_STRING_COPTIC_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT } - { AF_BLUE_STRING_COPTIC_SMALL_BOTTOM, 0 } - { AF_BLUE_STRING_MAX, 0 } - - AF_BLUE_STRINGSET_CPRT - { AF_BLUE_STRING_CYPRIOT_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_CYPRIOT_BOTTOM, 0 } - { AF_BLUE_STRING_CYPRIOT_SMALL, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_CYPRIOT_SMALL, 0 } - { AF_BLUE_STRING_MAX, 0 } - - AF_BLUE_STRINGSET_CYRL - { AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM, 0 } - { AF_BLUE_STRING_CYRILLIC_SMALL, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT } - { AF_BLUE_STRING_CYRILLIC_SMALL, 0 } - { AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER, 0 } - { AF_BLUE_STRING_MAX, 0 } - - AF_BLUE_STRINGSET_DEVA - { AF_BLUE_STRING_DEVANAGARI_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_DEVANAGARI_HEAD, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_DEVANAGARI_BASE, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_NEUTRAL | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT } - { AF_BLUE_STRING_DEVANAGARI_BASE, 0 } - { AF_BLUE_STRING_DEVANAGARI_BOTTOM, 0 } - { AF_BLUE_STRING_MAX, 0 } - - AF_BLUE_STRINGSET_DSRT - { AF_BLUE_STRING_DESERET_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_DESERET_CAPITAL_BOTTOM, 0 } - { AF_BLUE_STRING_DESERET_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT } - { AF_BLUE_STRING_DESERET_SMALL_BOTTOM, 0 } - { AF_BLUE_STRING_MAX, 0 } - - AF_BLUE_STRINGSET_ETHI - { AF_BLUE_STRING_ETHIOPIC_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_ETHIOPIC_BOTTOM, 0 } - { AF_BLUE_STRING_MAX, 0 } - - AF_BLUE_STRINGSET_GEOR - { AF_BLUE_STRING_GEORGIAN_MKHEDRULI_TOP, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT } - { AF_BLUE_STRING_GEORGIAN_MKHEDRULI_BOTTOM, 0 } - { AF_BLUE_STRING_GEORGIAN_MKHEDRULI_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_GEORGIAN_MKHEDRULI_DESCENDER, 0 } - { AF_BLUE_STRING_GEORGIAN_MTAVRULI_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_GEORGIAN_MTAVRULI_BOTTOM, 0 } - { AF_BLUE_STRING_MAX, 0 } - - AF_BLUE_STRINGSET_GEOK - { AF_BLUE_STRING_GEORGIAN_ASOMTAVRULI_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_GEORGIAN_ASOMTAVRULI_BOTTOM, 0 } - { AF_BLUE_STRING_GEORGIAN_NUSKHURI_TOP, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT } - { AF_BLUE_STRING_GEORGIAN_NUSKHURI_BOTTOM, 0 } - { AF_BLUE_STRING_GEORGIAN_NUSKHURI_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_GEORGIAN_NUSKHURI_DESCENDER, 0 } - { AF_BLUE_STRING_MAX, 0 } - - AF_BLUE_STRINGSET_GLAG - { AF_BLUE_STRING_GLAGOLITIC_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_GLAGOLITIC_CAPITAL_BOTTOM, 0 } - { AF_BLUE_STRING_GLAGOLITIC_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT } - { AF_BLUE_STRING_GLAGOLITIC_SMALL_BOTTOM, 0 } - { AF_BLUE_STRING_MAX, 0 } - - AF_BLUE_STRINGSET_GOTH - { AF_BLUE_STRING_GOTHIC_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_GOTHIC_BOTTOM, 0 } - { AF_BLUE_STRING_MAX, 0 } - - AF_BLUE_STRINGSET_GREK - { AF_BLUE_STRING_GREEK_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM, 0 } - { AF_BLUE_STRING_GREEK_SMALL_BETA_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_GREEK_SMALL, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT } - { AF_BLUE_STRING_GREEK_SMALL, 0 } - { AF_BLUE_STRING_GREEK_SMALL_DESCENDER, 0 } - { AF_BLUE_STRING_MAX, 0 } - - AF_BLUE_STRINGSET_GUJR - { AF_BLUE_STRING_GUJARATI_TOP, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT } - { AF_BLUE_STRING_GUJARATI_BOTTOM, 0 } - { AF_BLUE_STRING_GUJARATI_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_GUJARATI_DESCENDER, 0 } - { AF_BLUE_STRING_GUJARATI_DIGIT_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_MAX, 0 } - - AF_BLUE_STRINGSET_GURU - { AF_BLUE_STRING_GURMUKHI_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_GURMUKHI_HEAD, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_GURMUKHI_BASE, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_NEUTRAL | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT } - { AF_BLUE_STRING_GURMUKHI_BOTTOM, 0 } - { AF_BLUE_STRING_GURMUKHI_DIGIT_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_MAX, 0 } - - AF_BLUE_STRINGSET_HEBR - { AF_BLUE_STRING_HEBREW_TOP, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_LONG } - { AF_BLUE_STRING_HEBREW_BOTTOM, 0 } - { AF_BLUE_STRING_HEBREW_DESCENDER, 0 } - { AF_BLUE_STRING_MAX, 0 } - - AF_BLUE_STRINGSET_KNDA - { AF_BLUE_STRING_KANNADA_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_KANNADA_BOTTOM, 0 } - { AF_BLUE_STRING_MAX, 0 } - - AF_BLUE_STRINGSET_KALI - { AF_BLUE_STRING_KAYAH_LI_TOP, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT } - { AF_BLUE_STRING_KAYAH_LI_BOTTOM, 0 } - { AF_BLUE_STRING_KAYAH_LI_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_KAYAH_LI_DESCENDER, 0 } - { AF_BLUE_STRING_KAYAH_LI_LARGE_DESCENDER, 0 } - { AF_BLUE_STRING_MAX, 0 } - - AF_BLUE_STRINGSET_KHMR - { AF_BLUE_STRING_KHMER_TOP, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT } - { AF_BLUE_STRING_KHMER_SUBSCRIPT_TOP, AF_BLUE_PROPERTY_LATIN_SUB_TOP } - { AF_BLUE_STRING_KHMER_BOTTOM, 0 } - { AF_BLUE_STRING_KHMER_DESCENDER, 0 } - { AF_BLUE_STRING_KHMER_LARGE_DESCENDER, 0 } - { AF_BLUE_STRING_MAX, 0 } - - AF_BLUE_STRINGSET_KHMS - { AF_BLUE_STRING_KHMER_SYMBOLS_WAXING_TOP, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT } - { AF_BLUE_STRING_KHMER_SYMBOLS_WANING_BOTTOM, 0 } - { AF_BLUE_STRING_MAX, 0 } - - AF_BLUE_STRINGSET_LAO - { AF_BLUE_STRING_LAO_TOP, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT } - { AF_BLUE_STRING_LAO_BOTTOM, 0 } - { AF_BLUE_STRING_LAO_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_LAO_LARGE_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_LAO_DESCENDER, 0 } - { AF_BLUE_STRING_MAX, 0 } - - AF_BLUE_STRINGSET_LATN - { AF_BLUE_STRING_LATIN_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM, 0 } - { AF_BLUE_STRING_LATIN_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_LATIN_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT } - { AF_BLUE_STRING_LATIN_SMALL_BOTTOM, 0 } - { AF_BLUE_STRING_LATIN_SMALL_DESCENDER, 0 } - { AF_BLUE_STRING_MAX, 0 } - - AF_BLUE_STRINGSET_LATB - { AF_BLUE_STRING_LATIN_SUBS_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_LATIN_SUBS_CAPITAL_BOTTOM, 0 } - { AF_BLUE_STRING_LATIN_SUBS_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_LATIN_SUBS_SMALL, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT } - { AF_BLUE_STRING_LATIN_SUBS_SMALL, 0 } - { AF_BLUE_STRING_LATIN_SUBS_SMALL_DESCENDER, 0 } - { AF_BLUE_STRING_MAX, 0 } - - AF_BLUE_STRINGSET_LATP - { AF_BLUE_STRING_LATIN_SUPS_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_LATIN_SUPS_CAPITAL_BOTTOM, 0 } - { AF_BLUE_STRING_LATIN_SUPS_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_LATIN_SUPS_SMALL, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT } - { AF_BLUE_STRING_LATIN_SUPS_SMALL, 0 } - { AF_BLUE_STRING_LATIN_SUPS_SMALL_DESCENDER, 0 } - { AF_BLUE_STRING_MAX, 0 } - - AF_BLUE_STRINGSET_LISU - { AF_BLUE_STRING_LISU_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_LISU_BOTTOM, 0 } - { AF_BLUE_STRING_MAX, 0 } - - AF_BLUE_STRINGSET_MLYM - { AF_BLUE_STRING_MALAYALAM_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_MALAYALAM_BOTTOM, 0 } - { AF_BLUE_STRING_MAX, 0 } - - AF_BLUE_STRINGSET_MEDF - { AF_BLUE_STRING_MEDEFAIDRIN_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_MEDEFAIDRIN_CAPITAL_BOTTOM, 0 } - { AF_BLUE_STRING_MEDEFAIDRIN_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_MEDEFAIDRIN_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT } - { AF_BLUE_STRING_MEDEFAIDRIN_SMALL_BOTTOM, 0 } - { AF_BLUE_STRING_MEDEFAIDRIN_SMALL_DESCENDER, 0 } - { AF_BLUE_STRING_MEDEFAIDRIN_DIGIT_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_MAX, 0 } - - AF_BLUE_STRINGSET_MONG - { AF_BLUE_STRING_MONGOLIAN_TOP_BASE, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_MONGOLIAN_BOTTOM_BASE, 0 } - { AF_BLUE_STRING_MAX, 0 } - - AF_BLUE_STRINGSET_MYMR - { AF_BLUE_STRING_MYANMAR_TOP, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT } - { AF_BLUE_STRING_MYANMAR_BOTTOM, 0 } - { AF_BLUE_STRING_MYANMAR_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_MYANMAR_DESCENDER, 0 } - { AF_BLUE_STRING_MAX, 0 } - - AF_BLUE_STRINGSET_NKOO - { AF_BLUE_STRING_NKO_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_NKO_BOTTOM, 0 } - { AF_BLUE_STRING_NKO_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT } - { AF_BLUE_STRING_NKO_SMALL_BOTTOM, 0 } - { AF_BLUE_STRING_MAX, 0 } - - AF_BLUE_STRINGSET_NONE - { AF_BLUE_STRING_MAX, 0 } - - AF_BLUE_STRINGSET_OLCK - { AF_BLUE_STRING_OL_CHIKI, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_OL_CHIKI, 0 } - { AF_BLUE_STRING_MAX, 0 } - - AF_BLUE_STRINGSET_ORKH - { AF_BLUE_STRING_OLD_TURKIC_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_OLD_TURKIC_BOTTOM, 0 } - { AF_BLUE_STRING_MAX, 0 } - - AF_BLUE_STRINGSET_OSGE - { AF_BLUE_STRING_OSAGE_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_OSAGE_CAPITAL_BOTTOM, 0 } - { AF_BLUE_STRING_OSAGE_CAPITAL_DESCENDER, 0 } - { AF_BLUE_STRING_OSAGE_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT } - { AF_BLUE_STRING_OSAGE_SMALL_BOTTOM, 0 } - { AF_BLUE_STRING_OSAGE_SMALL_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_OSAGE_SMALL_DESCENDER, 0 } - { AF_BLUE_STRING_MAX, 0 } - - AF_BLUE_STRINGSET_OSMA - { AF_BLUE_STRING_OSMANYA_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_OSMANYA_BOTTOM, 0 } - { AF_BLUE_STRING_MAX, 0 } - - AF_BLUE_STRINGSET_ROHG - { AF_BLUE_STRING_ROHINGYA_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_ROHINGYA_BOTTOM, 0 } - { AF_BLUE_STRING_ROHINGYA_JOIN, AF_BLUE_PROPERTY_LATIN_NEUTRAL } - { AF_BLUE_STRING_MAX, 0 } - - AF_BLUE_STRINGSET_SAUR - { AF_BLUE_STRING_SAURASHTRA_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_SAURASHTRA_BOTTOM, 0 } - { AF_BLUE_STRING_MAX, 0 } - - AF_BLUE_STRINGSET_SHAW - { AF_BLUE_STRING_SHAVIAN_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_SHAVIAN_BOTTOM, 0 } - { AF_BLUE_STRING_SHAVIAN_DESCENDER, 0 } - { AF_BLUE_STRING_SHAVIAN_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT } - { AF_BLUE_STRING_SHAVIAN_SMALL_BOTTOM, 0 } - { AF_BLUE_STRING_MAX, 0 } - - AF_BLUE_STRINGSET_SINH - { AF_BLUE_STRING_SINHALA_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_SINHALA_BOTTOM, 0 } - { AF_BLUE_STRING_SINHALA_DESCENDER, 0 } - { AF_BLUE_STRING_MAX, 0 } - - AF_BLUE_STRINGSET_SUND - { AF_BLUE_STRING_SUNDANESE_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_SUNDANESE_BOTTOM, 0 } - { AF_BLUE_STRING_SUNDANESE_DESCENDER, 0 } - { AF_BLUE_STRING_MAX, 0 } - - AF_BLUE_STRINGSET_TAML - { AF_BLUE_STRING_TAMIL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_TAMIL_BOTTOM, 0 } - { AF_BLUE_STRING_MAX, 0 } - - AF_BLUE_STRINGSET_TAVT - { AF_BLUE_STRING_TAI_VIET_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_TAI_VIET_BOTTOM, 0 } - { AF_BLUE_STRING_MAX, 0 } - - AF_BLUE_STRINGSET_TELU - { AF_BLUE_STRING_TELUGU_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_TELUGU_BOTTOM, 0 } - { AF_BLUE_STRING_MAX, 0 } - - AF_BLUE_STRINGSET_THAI - { AF_BLUE_STRING_THAI_TOP, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT } - { AF_BLUE_STRING_THAI_BOTTOM, 0 } - { AF_BLUE_STRING_THAI_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_THAI_LARGE_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_THAI_DESCENDER, 0 } - { AF_BLUE_STRING_THAI_LARGE_DESCENDER, 0 } - { AF_BLUE_STRING_THAI_DIGIT_TOP, 0 } - { AF_BLUE_STRING_MAX, 0 } - - AF_BLUE_STRINGSET_TFNG - { AF_BLUE_STRING_TIFINAGH, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_TIFINAGH, 0 } - { AF_BLUE_STRING_MAX, 0 } - - AF_BLUE_STRINGSET_VAII - { AF_BLUE_STRING_VAI_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_VAI_BOTTOM, 0 } - { AF_BLUE_STRING_MAX, 0 } - -#ifdef AF_CONFIG_OPTION_CJK - - AF_BLUE_STRINGSET_HANI - { AF_BLUE_STRING_CJK_TOP, AF_BLUE_PROPERTY_CJK_TOP } - { AF_BLUE_STRING_CJK_BOTTOM, 0 } -#ifdef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT - { AF_BLUE_STRING_CJK_LEFT, AF_BLUE_PROPERTY_CJK_HORIZ } - { AF_BLUE_STRING_CJK_RIGHT, AF_BLUE_PROPERTY_CJK_HORIZ | - AF_BLUE_PROPERTY_CJK_RIGHT } -#endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */ - { AF_BLUE_STRING_MAX, 0 } - -#endif /* AF_CONFIG_OPTION_CJK */ - - -// END +// afblue.dat +// +// Auto-fitter data for blue strings. +// +// Copyright (C) 2013-2024 by +// David Turner, Robert Wilhelm, and Werner Lemberg. +// +// This file is part of the FreeType project, and may only be used, +// modified, and distributed under the terms of the FreeType project +// license, LICENSE.TXT. By continuing to use, modify, or distribute +// this file you indicate that you have read the license and +// understand and accept it fully. + + +// This file contains data specific to blue zones. It gets processed by +// a script to simulate `jagged arrays', with enumeration values holding +// offsets into the arrays. +// +// The format of the file is rather simple: A section starts with three +// labels separated by whitespace and followed by a colon (everything in a +// single line); the first label gives the name of the enumeration template, +// the second the name of the array template, and the third the name of the +// `maximum' template. The script then fills the corresponding templates +// (indicated by `@' characters around the name). +// +// A section contains one or more data records. Each data record consists +// of two or more lines. The first line holds the enumeration name, and the +// remaining lines the corresponding array data. +// +// There are two possible representations for array data. +// +// - A string of characters or character clusters (for example, representing +// Aksharas, Devanagari syllables) in UTF-8 encoding enclosed in double +// quotes, using C syntax, where the elements are separated by spaces. +// There can be only one string per line, thus the starting and ending +// double quote must be the first and last character in the line, +// respectively, ignoring whitespace before and after the string. If +// there are multiple strings (in multiple lines), they are concatenated +// to a single string. In the output, a string gets represented as a +// series of singles bytes, followed by a zero byte. The enumeration +// values simply hold byte offsets to the start of the corresponding +// strings. +// +// For strings, the `maximum' template holds the maximum number of +// non-space characters in all strings. +// +// - Data blocks enclosed in balanced braces, which get copied verbatim and +// which can span multiple lines. The opening brace of a block must be +// the first character of a line (ignoring whitespace), and the closing +// brace the last (ignoring whitespace also). The script appends a comma +// character after each block and counts the number of blocks to set the +// enumeration values. +// +// For data blocks, the `maximum' template holds the maximum number of +// array elements. +// +// A section can contain either strings only or data blocks only. +// +// A comment line starts with `//'; it gets removed. A preprocessor +// directive line (using the standard syntax of `cpp') starts with `#' and +// gets copied verbatim to both the enumeration and the array. Whitespace +// outside of a string is insignificant. +// +// Preprocessor directives are ignored while the script computes maximum +// values; this essentially means that the maximum values can easily be too +// large. Given that the purpose of those values is to create local +// fixed-size arrays at compile time for further processing of the blue zone +// data, this isn't a problem. Note the final zero byte of a string is not +// counted. Note also that the count holds the number of UTF-8 encoded +// characters, not bytes. + + +// The blue zone string data, to be used in the blue stringsets below. + +AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN: + + AF_BLUE_STRING_ADLAM_CAPITAL_TOP + "𞤌 𞤅 𞤈 𞤏 𞤔 𞤚" + AF_BLUE_STRING_ADLAM_CAPITAL_BOTTOM + "𞤂 𞤖" + AF_BLUE_STRING_ADLAM_SMALL_TOP + "𞤬 𞤮 𞤻 𞤼 𞤾" + AF_BLUE_STRING_ADLAM_SMALL_BOTTOM + "𞤤 𞤨 𞤩 𞤭 𞤴 𞤸 𞤺 𞥀" + + AF_BLUE_STRING_ARABIC_TOP + "ا إ ل ك ط ظ" + AF_BLUE_STRING_ARABIC_BOTTOM + "ت ث ط ظ ك" + // We don't necessarily have access to medial forms via Unicode in case + // Arabic presentational forms are missing. The only character that is + // guaranteed to have the same vertical position with joining (that is, + // non-isolated) forms is U+0640, ARABIC TATWEEL, which must join both + // round and flat curves. + AF_BLUE_STRING_ARABIC_JOIN + "ـ" + + AF_BLUE_STRING_ARMENIAN_CAPITAL_TOP + "Ա Մ Ւ Ս Բ Գ Դ Օ" + AF_BLUE_STRING_ARMENIAN_CAPITAL_BOTTOM + "Ւ Ո Դ Ճ Շ Ս Տ Օ" + AF_BLUE_STRING_ARMENIAN_SMALL_ASCENDER + "ե է ի մ վ ֆ ճ" + AF_BLUE_STRING_ARMENIAN_SMALL_TOP + "ա յ ւ ս գ շ ր օ" + AF_BLUE_STRING_ARMENIAN_SMALL_BOTTOM + "հ ո ճ ա ե ծ ս օ" + AF_BLUE_STRING_ARMENIAN_SMALL_DESCENDER + "բ ը ի լ ղ պ փ ց" + + AF_BLUE_STRING_AVESTAN_TOP + "𐬀 𐬁 𐬐 𐬛" + AF_BLUE_STRING_AVESTAN_BOTTOM + "𐬀 𐬁" + + AF_BLUE_STRING_BAMUM_TOP + "ꚧ ꚨ ꛛ ꛉ ꛁ ꛈ ꛫ ꛯ" + AF_BLUE_STRING_BAMUM_BOTTOM + "ꚭ ꚳ ꚶ ꛬ ꚢ ꚽ ꛯ ꛲" + + AF_BLUE_STRING_BENGALI_BASE + "অ ড ত ন ব ভ ল ক" + AF_BLUE_STRING_BENGALI_TOP + "ই ট ঠ ি ী ৈ ৗ" + AF_BLUE_STRING_BENGALI_HEAD + "ও এ ড ত ন ব ল ক" + + AF_BLUE_STRING_BUHID_TOP + "ᝐ ᝈ" + AF_BLUE_STRING_BUHID_LARGE + "ᝅ ᝊ ᝎ" + AF_BLUE_STRING_BUHID_SMALL + "ᝂ ᝃ ᝉ ᝌ" + AF_BLUE_STRING_BUHID_BOTTOM + "ᝀ ᝃ ᝆ ᝉ ᝋ ᝏ ᝑ" + + AF_BLUE_STRING_CANADIAN_SYLLABICS_TOP + "ᗜ ᖴ ᐁ ᒣ ᑫ ᑎ ᔑ ᗰ" + AF_BLUE_STRING_CANADIAN_SYLLABICS_BOTTOM + "ᗶ ᖵ ᒧ ᐃ ᑌ ᒍ ᔑ ᗢ" + AF_BLUE_STRING_CANADIAN_SYLLABICS_SMALL_TOP + "ᓓ ᓕ ᓀ ᓂ ᓄ ᕄ ᕆ ᘣ" + AF_BLUE_STRING_CANADIAN_SYLLABICS_SMALL_BOTTOM + "ᕃ ᓂ ᓀ ᕂ ᓗ ᓚ ᕆ ᘣ" + AF_BLUE_STRING_CANADIAN_SYLLABICS_SUPS_TOP + "ᐪ ᙆ ᣘ ᐢ ᒾ ᣗ ᔆ" + AF_BLUE_STRING_CANADIAN_SYLLABICS_SUPS_BOTTOM + "ᙆ ᗮ ᒻ ᐞ ᔆ ᒡ ᒢ ᓑ" + + AF_BLUE_STRING_CARIAN_TOP + "𐊧 𐊫 𐊬 𐊭 𐊱 𐊺 𐊼 𐊿" + AF_BLUE_STRING_CARIAN_BOTTOM + "𐊣 𐊧 𐊷 𐋀 𐊫 𐊸 𐋉" + + AF_BLUE_STRING_CHAKMA_TOP + "𑄃 𑄅 𑄉 𑄙 𑄗" + AF_BLUE_STRING_CHAKMA_BOTTOM + "𑄅 𑄛 𑄝 𑄗 𑄓" + AF_BLUE_STRING_CHAKMA_DESCENDER + "𑄖𑄳𑄢 𑄘𑄳𑄢 𑄙𑄳𑄢 𑄤𑄳𑄢 𑄥𑄳𑄢" + + AF_BLUE_STRING_CHEROKEE_CAPITAL + "Ꮖ Ꮋ Ꭼ Ꮓ Ꭴ Ꮳ Ꭶ Ꮥ" + AF_BLUE_STRING_CHEROKEE_SMALL_ASCENDER + "ꮒ ꮤ ꮶ ꭴ ꭾ ꮗ ꮝ ꮿ" + AF_BLUE_STRING_CHEROKEE_SMALL + "ꮖ ꭼ ꮓ ꮠ ꮳ ꭶ ꮥ ꮻ" + AF_BLUE_STRING_CHEROKEE_SMALL_DESCENDER + "ᏸ ꮐ ꭹ ꭻ" + + AF_BLUE_STRING_COPTIC_CAPITAL_TOP + "Ⲍ Ⲏ Ⲡ Ⳟ Ⲟ Ⲑ Ⲥ Ⳋ" + AF_BLUE_STRING_COPTIC_CAPITAL_BOTTOM + "Ⳑ Ⳙ Ⳟ Ⲏ Ⲟ Ⲑ Ⳝ Ⲱ" + AF_BLUE_STRING_COPTIC_SMALL_TOP + "ⲍ ⲏ ⲡ ⳟ ⲟ ⲑ ⲥ ⳋ" + AF_BLUE_STRING_COPTIC_SMALL_BOTTOM + "ⳑ ⳙ ⳟ ⲏ ⲟ ⲑ ⳝ Ⳓ" + + AF_BLUE_STRING_CYPRIOT_TOP + "𐠍 𐠙 𐠳 𐠱 𐠅 𐠓 𐠣 𐠦" + AF_BLUE_STRING_CYPRIOT_BOTTOM + "𐠃 𐠊 𐠛 𐠣 𐠳 𐠵 𐠐" + AF_BLUE_STRING_CYPRIOT_SMALL + "𐠈 𐠏 𐠖" + + AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP + "Б В Е П З О С Э" + AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM + "Б В Е Ш З О С Э" + AF_BLUE_STRING_CYRILLIC_SMALL + "х п н ш е з о с" + AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER + "р у ф" + + AF_BLUE_STRING_DESERET_CAPITAL_TOP + "𐐂 𐐄 𐐋 𐐗 𐐑" + AF_BLUE_STRING_DESERET_CAPITAL_BOTTOM + "𐐀 𐐂 𐐄 𐐗 𐐛" + AF_BLUE_STRING_DESERET_SMALL_TOP + "𐐪 𐐬 𐐳 𐐿 𐐹" + AF_BLUE_STRING_DESERET_SMALL_BOTTOM + "𐐨 𐐪 𐐬 𐐿 𐑃" + + AF_BLUE_STRING_DEVANAGARI_BASE + "क न म उ छ ट ठ ड" + AF_BLUE_STRING_DEVANAGARI_TOP + "ई ऐ ओ औ ि ी ो ौ" + // note that some fonts have extreme variation in the height of the + // round head elements; for this reason we also define the `base' + // blue zone, which must be always present + AF_BLUE_STRING_DEVANAGARI_HEAD + "क म अ आ थ ध भ श" + AF_BLUE_STRING_DEVANAGARI_BOTTOM + "ु ृ" + + AF_BLUE_STRING_ETHIOPIC_TOP + "ሀ ሃ ዘ ፐ ማ በ ዋ ዐ" + AF_BLUE_STRING_ETHIOPIC_BOTTOM + "ለ ሐ በ ዘ ሀ ሪ ዐ ጨ" + + AF_BLUE_STRING_GEORGIAN_MKHEDRULI_TOP + "გ დ ე ვ თ ი ო ღ" + AF_BLUE_STRING_GEORGIAN_MKHEDRULI_BOTTOM + "ა ზ მ ს შ ძ ხ პ" + AF_BLUE_STRING_GEORGIAN_MKHEDRULI_ASCENDER + "ს ხ ქ ზ მ შ ჩ წ" + AF_BLUE_STRING_GEORGIAN_MKHEDRULI_DESCENDER + "ე ვ ჟ ტ უ ფ ქ ყ" + + AF_BLUE_STRING_GEORGIAN_ASOMTAVRULI_TOP + "Ⴑ Ⴇ Ⴙ Ⴜ Ⴄ Ⴅ Ⴓ Ⴚ" + AF_BLUE_STRING_GEORGIAN_ASOMTAVRULI_BOTTOM + "Ⴄ Ⴅ Ⴇ Ⴈ Ⴆ Ⴑ Ⴊ Ⴋ" + + AF_BLUE_STRING_GEORGIAN_NUSKHURI_TOP + "ⴁ ⴗ ⴂ ⴄ ⴅ ⴇ ⴔ ⴖ" + AF_BLUE_STRING_GEORGIAN_NUSKHURI_BOTTOM + "ⴈ ⴌ ⴖ ⴎ ⴃ ⴆ ⴋ ⴢ" + AF_BLUE_STRING_GEORGIAN_NUSKHURI_ASCENDER + "ⴐ ⴑ ⴓ ⴕ ⴙ ⴛ ⴡ ⴣ" + AF_BLUE_STRING_GEORGIAN_NUSKHURI_DESCENDER + "ⴄ ⴅ ⴔ ⴕ ⴁ ⴂ ⴘ ⴝ" + + AF_BLUE_STRING_GEORGIAN_MTAVRULI_TOP + "Ნ Ჟ Ჳ Ჸ Გ Ე Ო Ჴ" + AF_BLUE_STRING_GEORGIAN_MTAVRULI_BOTTOM + "Ი Ჲ Ო Ჩ Მ Შ Ჯ Ჽ" + + AF_BLUE_STRING_GLAGOLITIC_CAPITAL_TOP + "Ⰵ Ⱄ Ⱚ Ⰴ Ⰲ Ⰺ Ⱛ Ⰻ" + AF_BLUE_STRING_GLAGOLITIC_CAPITAL_BOTTOM + "Ⰵ Ⰴ Ⰲ Ⱚ Ⱎ Ⱑ Ⰺ Ⱄ" + AF_BLUE_STRING_GLAGOLITIC_SMALL_TOP + "ⰵ ⱄ ⱚ ⰴ ⰲ ⰺ ⱛ ⰻ" + AF_BLUE_STRING_GLAGOLITIC_SMALL_BOTTOM + "ⰵ ⰴ ⰲ ⱚ ⱎ ⱑ ⰺ ⱄ" + + AF_BLUE_STRING_GOTHIC_TOP + "𐌲 𐌶 𐍀 𐍄 𐌴 𐍃 𐍈 𐌾" + AF_BLUE_STRING_GOTHIC_BOTTOM + "𐌶 𐌴 𐍃 𐍈" + + AF_BLUE_STRING_GREEK_CAPITAL_TOP + "Γ Β Ε Ζ Θ Ο Ω" + AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM + "Β Δ Ζ Ξ Θ Ο" + AF_BLUE_STRING_GREEK_SMALL_BETA_TOP + "β θ δ ζ λ ξ" + AF_BLUE_STRING_GREEK_SMALL + "α ε ι ο π σ τ ω" + AF_BLUE_STRING_GREEK_SMALL_DESCENDER + "β γ η μ ρ φ χ ψ" + + AF_BLUE_STRING_GUJARATI_TOP + "ત ન ઋ ઌ છ ટ ર ૦" + AF_BLUE_STRING_GUJARATI_BOTTOM + "ખ ગ ઘ ઞ ઇ ઈ ઠ જ" + AF_BLUE_STRING_GUJARATI_ASCENDER + "ઈ ઊ િ ી લી શ્ચિ જિ સી" + AF_BLUE_STRING_GUJARATI_DESCENDER + "ુ ૃ ૄ ખુ છૃ છૄ" + AF_BLUE_STRING_GUJARATI_DIGIT_TOP + "૦ ૧ ૨ ૩ ૭" + + AF_BLUE_STRING_GURMUKHI_BASE + "ਕ ਗ ਙ ਚ ਜ ਤ ਧ ਸ" + AF_BLUE_STRING_GURMUKHI_HEAD + "ਕ ਗ ਙ ਚ ਜ ਤ ਧ ਸ" + AF_BLUE_STRING_GURMUKHI_TOP + "ਇ ਈ ਉ ਏ ਓ ੳ ਿ ੀ" + AF_BLUE_STRING_GURMUKHI_BOTTOM + "ਅ ਏ ਓ ਗ ਜ ਠ ਰ ਸ" + AF_BLUE_STRING_GURMUKHI_DIGIT_TOP + "੦ ੧ ੨ ੩ ੭" + + AF_BLUE_STRING_HEBREW_TOP + "ב ד ה ח ך כ ם ס" + AF_BLUE_STRING_HEBREW_BOTTOM + "ב ט כ ם ס צ" + AF_BLUE_STRING_HEBREW_DESCENDER + "ק ך ן ף ץ" + + AF_BLUE_STRING_KANNADA_TOP + "ಇ ಊ ಐ ಣ ಸಾ ನಾ ದಾ ರಾ" + AF_BLUE_STRING_KANNADA_BOTTOM + "ಅ ಉ ಎ ಲ ೦ ೨ ೬ ೭" + + AF_BLUE_STRING_KAYAH_LI_TOP + "꤅ ꤏ ꤁ ꤋ ꤀ ꤍ" + AF_BLUE_STRING_KAYAH_LI_BOTTOM + "꤈ ꤘ ꤀ ꤍ ꤢ" + AF_BLUE_STRING_KAYAH_LI_ASCENDER + "ꤖ ꤡ" + AF_BLUE_STRING_KAYAH_LI_DESCENDER + "ꤑ ꤜ ꤞ" + AF_BLUE_STRING_KAYAH_LI_LARGE_DESCENDER + "ꤑ꤬ ꤜ꤭ ꤔ꤬" + + AF_BLUE_STRING_KHMER_TOP + "ខ ទ ន ឧ ឩ ា" + AF_BLUE_STRING_KHMER_SUBSCRIPT_TOP + "ក្ក ក្ខ ក្គ ក្ថ" + AF_BLUE_STRING_KHMER_BOTTOM + "ខ ឃ ច ឋ ប ម យ ឲ" + AF_BLUE_STRING_KHMER_DESCENDER + "ត្រ រៀ ឲ្យ អឿ" + AF_BLUE_STRING_KHMER_LARGE_DESCENDER + "ន្ត្រៃ ង្ខ្យ ក្បៀ ច្រៀ ន្តឿ ល្បឿ" + + AF_BLUE_STRING_KHMER_SYMBOLS_WAXING_TOP + "᧠ ᧡" + AF_BLUE_STRING_KHMER_SYMBOLS_WANING_BOTTOM + "᧶ ᧹" + + AF_BLUE_STRING_LAO_TOP + "າ ດ ອ ມ ລ ວ ຣ ງ" + AF_BLUE_STRING_LAO_BOTTOM + "າ ອ ບ ຍ ຣ ຮ ວ ຢ" + AF_BLUE_STRING_LAO_ASCENDER + "ປ ຢ ຟ ຝ" + AF_BLUE_STRING_LAO_LARGE_ASCENDER + "ໂ ໄ ໃ" + AF_BLUE_STRING_LAO_DESCENDER + "ງ ຊ ຖ ຽ ໆ ຯ" + + AF_BLUE_STRING_LATIN_CAPITAL_TOP + "T H E Z O C Q S" + AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM + "H E Z L O C U S" + AF_BLUE_STRING_LATIN_SMALL_F_TOP + "f i j k d b h" + AF_BLUE_STRING_LATIN_SMALL_TOP + "u v x z o e s c" + AF_BLUE_STRING_LATIN_SMALL_BOTTOM + "n r x z o e s c" + AF_BLUE_STRING_LATIN_SMALL_DESCENDER + "p q g j y" + + // we assume that both the subscript and superscript ranges + // don't contain oldstyle digits (actually, most fonts probably + // have digits only in those ranges) + AF_BLUE_STRING_LATIN_SUBS_CAPITAL_TOP + "₀ ₃ ₅ ₇ ₈" + AF_BLUE_STRING_LATIN_SUBS_CAPITAL_BOTTOM + "₀ ₁ ₂ ₃ ₈" + AF_BLUE_STRING_LATIN_SUBS_SMALL_F_TOP + "ᵢ ⱼ ₕ ₖ ₗ" + AF_BLUE_STRING_LATIN_SUBS_SMALL + "ₐ ₑ ₒ ₓ ₙ ₛ ᵥ ᵤ ᵣ" + AF_BLUE_STRING_LATIN_SUBS_SMALL_DESCENDER + "ᵦ ᵧ ᵨ ᵩ ₚ" + + AF_BLUE_STRING_LATIN_SUPS_CAPITAL_TOP + "⁰ ³ ⁵ ⁷ ᵀ ᴴ ᴱ ᴼ" + AF_BLUE_STRING_LATIN_SUPS_CAPITAL_BOTTOM + "⁰ ¹ ² ³ ᴱ ᴸ ᴼ ᵁ" + AF_BLUE_STRING_LATIN_SUPS_SMALL_F_TOP + "ᵇ ᵈ ᵏ ʰ ʲ ᶠ ⁱ" + AF_BLUE_STRING_LATIN_SUPS_SMALL + "ᵉ ᵒ ʳ ˢ ˣ ᶜ ᶻ" + AF_BLUE_STRING_LATIN_SUPS_SMALL_DESCENDER + "ᵖ ʸ ᵍ" + + AF_BLUE_STRING_LISU_TOP + "ꓡ ꓧ ꓱ ꓶ ꓩ ꓚ ꓵ ꓳ" + AF_BLUE_STRING_LISU_BOTTOM + "ꓕ ꓜ ꓞ ꓡ ꓛ ꓢ ꓳ ꓴ" + + AF_BLUE_STRING_MALAYALAM_TOP + "ഒ ട ഠ റ ച പ ച്ച പ്പ" + AF_BLUE_STRING_MALAYALAM_BOTTOM + "ട ഠ ധ ശ ഘ ച ഥ ല" + + AF_BLUE_STRING_MEDEFAIDRIN_CAPITAL_TOP + "𖹀 𖹁 𖹂 𖹃 𖹏 𖹚 𖹟" + AF_BLUE_STRING_MEDEFAIDRIN_CAPITAL_BOTTOM + "𖹀 𖹁 𖹂 𖹃 𖹏 𖹚 𖹒 𖹓" + AF_BLUE_STRING_MEDEFAIDRIN_SMALL_F_TOP + "𖹤 𖹬 𖹧 𖹴 𖹶 𖹾" + AF_BLUE_STRING_MEDEFAIDRIN_SMALL_TOP + "𖹠 𖹡 𖹢 𖹹 𖹳 𖹮" + AF_BLUE_STRING_MEDEFAIDRIN_SMALL_BOTTOM + "𖹠 𖹡 𖹢 𖹳 𖹭 𖹽" + AF_BLUE_STRING_MEDEFAIDRIN_SMALL_DESCENDER + "𖹥 𖹨 𖹩" + AF_BLUE_STRING_MEDEFAIDRIN_DIGIT_TOP + "𖺀 𖺅 𖺈 𖺄 𖺍" + + AF_BLUE_STRING_MONGOLIAN_TOP_BASE + "ᠳ ᠴ ᠶ ᠽ ᡂ ᡊ ‍ᡡ‍ ‍ᡳ‍" + AF_BLUE_STRING_MONGOLIAN_BOTTOM_BASE + "ᡃ" + + AF_BLUE_STRING_MYANMAR_TOP + "ခ ဂ င ဒ ဝ ၥ ၊ ။" + AF_BLUE_STRING_MYANMAR_BOTTOM + "င ဎ ဒ ပ ဗ ဝ ၊ ။" + AF_BLUE_STRING_MYANMAR_ASCENDER + "ဩ ြ ၍ ၏ ၆ ါ ိ" + AF_BLUE_STRING_MYANMAR_DESCENDER + "ဉ ည ဥ ဩ ဨ ၂ ၅ ၉" + + AF_BLUE_STRING_NKO_TOP + "ߐ ߉ ߒ ߟ ߖ ߜ ߠ ߥ" + AF_BLUE_STRING_NKO_BOTTOM + "߀ ߘ ߡ ߠ ߥ" + AF_BLUE_STRING_NKO_SMALL_TOP + "ߏ ߛ ߋ" + AF_BLUE_STRING_NKO_SMALL_BOTTOM + "ߎ ߏ ߛ ߋ" + + AF_BLUE_STRING_OL_CHIKI + "ᱛ ᱜ ᱝ ᱡ ᱢ ᱥ" + + AF_BLUE_STRING_OLD_TURKIC_TOP + "𐰗 𐰘 𐰧" + AF_BLUE_STRING_OLD_TURKIC_BOTTOM + "𐰉 𐰗 𐰦 𐰧" + + AF_BLUE_STRING_OSAGE_CAPITAL_TOP + "𐒾 𐓍 𐓒 𐓓 𐒻 𐓂 𐒵 𐓆" + AF_BLUE_STRING_OSAGE_CAPITAL_BOTTOM + "𐒰 𐓍 𐓂 𐒿 𐓎 𐒹" + AF_BLUE_STRING_OSAGE_CAPITAL_DESCENDER + "𐒼 𐒽 𐒾" + AF_BLUE_STRING_OSAGE_SMALL_TOP + "𐓵 𐓶 𐓺 𐓻 𐓝 𐓣 𐓪 𐓮" + AF_BLUE_STRING_OSAGE_SMALL_BOTTOM + "𐓘 𐓚 𐓣 𐓵 𐓡 𐓧 𐓪 𐓶" + AF_BLUE_STRING_OSAGE_SMALL_ASCENDER + "𐓤 𐓦 𐓸 𐓹 𐓛" + AF_BLUE_STRING_OSAGE_SMALL_DESCENDER + "𐓤 𐓥 𐓦" + + AF_BLUE_STRING_OSMANYA_TOP + "𐒆 𐒉 𐒐 𐒒 𐒘 𐒛 𐒠 𐒣" + AF_BLUE_STRING_OSMANYA_BOTTOM + "𐒀 𐒂 𐒆 𐒈 𐒊 𐒒 𐒠 𐒩" + + AF_BLUE_STRING_ROHINGYA_TOP + "𐴃 𐴀 𐴆 𐴖 𐴕" + AF_BLUE_STRING_ROHINGYA_BOTTOM + "𐴔 𐴖 𐴕 𐴑 𐴐" + AF_BLUE_STRING_ROHINGYA_JOIN + "ـ" + + AF_BLUE_STRING_SAURASHTRA_TOP + "ꢜ ꢞ ꢳ ꢂ ꢖ ꢒ ꢝ ꢛ" + AF_BLUE_STRING_SAURASHTRA_BOTTOM + "ꢂ ꢨ ꢺ ꢤ ꢎ" + + AF_BLUE_STRING_SHAVIAN_TOP + "𐑕 𐑙" + AF_BLUE_STRING_SHAVIAN_BOTTOM + "𐑔 𐑖 𐑗 𐑹 𐑻" + AF_BLUE_STRING_SHAVIAN_DESCENDER + "𐑟 𐑣" + AF_BLUE_STRING_SHAVIAN_SMALL_TOP + "𐑱 𐑲 𐑳 𐑴 𐑸 𐑺 𐑼" + AF_BLUE_STRING_SHAVIAN_SMALL_BOTTOM + "𐑴 𐑻 𐑹" + + AF_BLUE_STRING_SINHALA_TOP + "ඉ ක ඝ ඳ ප ය ල ෆ" + AF_BLUE_STRING_SINHALA_BOTTOM + "එ ඔ ඝ ජ ට ථ ධ ර" + AF_BLUE_STRING_SINHALA_DESCENDER + "ද ඳ උ ල තූ තු බු දු" + + AF_BLUE_STRING_SUNDANESE_TOP + "ᮋ ᮞ ᮮ ᮽ ᮰ ᮈ" + AF_BLUE_STRING_SUNDANESE_BOTTOM + "ᮄ ᮔ ᮕ ᮗ ᮰ ᮆ ᮈ ᮉ" + AF_BLUE_STRING_SUNDANESE_DESCENDER + "ᮼ ᳄" + + AF_BLUE_STRING_TAI_VIET_TOP + "ꪆ ꪔ ꪒ ꪖ ꪫ" + AF_BLUE_STRING_TAI_VIET_BOTTOM + "ꪉ ꪫ ꪮ" + + AF_BLUE_STRING_TAMIL_TOP + "உ ஒ ஓ ற ஈ க ங ச" + AF_BLUE_STRING_TAMIL_BOTTOM + "க ச ல ஶ உ ங ட ப" + + AF_BLUE_STRING_TELUGU_TOP + "ఇ ఌ ఙ ఞ ణ ఱ ౯" + AF_BLUE_STRING_TELUGU_BOTTOM + "అ క చ ర ఽ ౨ ౬" + + AF_BLUE_STRING_THAI_TOP + "บ เ แ อ ก า" + AF_BLUE_STRING_THAI_BOTTOM + "บ ป ษ ฯ อ ย ฮ" + AF_BLUE_STRING_THAI_ASCENDER + "ป ฝ ฟ" + AF_BLUE_STRING_THAI_LARGE_ASCENDER + "โ ใ ไ" + AF_BLUE_STRING_THAI_DESCENDER + "ฎ ฏ ฤ ฦ" + AF_BLUE_STRING_THAI_LARGE_DESCENDER + "ญ ฐ" + AF_BLUE_STRING_THAI_DIGIT_TOP + "๐ ๑ ๓" + + AF_BLUE_STRING_TIFINAGH + "ⵔ ⵙ ⵛ ⵞ ⴵ ⴼ ⴹ ⵎ" + + AF_BLUE_STRING_VAI_TOP + "ꗍ ꘖ ꘙ ꘜ ꖜ ꖝ ꔅ ꕢ" + AF_BLUE_STRING_VAI_BOTTOM + "ꗍ ꘖ ꘙ ꗞ ꔅ ꕢ ꖜ ꔆ" + + +#ifdef AF_CONFIG_OPTION_CJK + + AF_BLUE_STRING_CJK_TOP + "他 们 你 來 們 到 和 地" + " 对 對 就 席 我 时 時 會" + " 来 為 能 舰 說 说 这 這" + " 齊 |" + " 军 同 已 愿 既 星 是 景" + " 民 照 现 現 理 用 置 要" + " 軍 那 配 里 開 雷 露 面" + " 顾" + AF_BLUE_STRING_CJK_BOTTOM + "个 为 人 他 以 们 你 來" + " 個 們 到 和 大 对 對 就" + " 我 时 時 有 来 為 要 說" + " 说 |" + " 主 些 因 它 想 意 理 生" + " 當 看 着 置 者 自 著 裡" + " 过 还 进 進 過 道 還 里" + " 面" + +#ifdef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT + + AF_BLUE_STRING_CJK_LEFT + " 些 们 你 來 們 到 和 地" + " 她 将 將 就 年 得 情 最" + " 样 樣 理 能 說 说 这 這" + " 通 |" + " 即 吗 吧 听 呢 品 响 嗎" + " 师 師 收 断 斷 明 眼 間" + " 间 际 陈 限 除 陳 随 際" + " 隨" + AF_BLUE_STRING_CJK_RIGHT + "事 前 學 将 將 情 想 或" + " 政 斯 新 样 樣 民 沒 没" + " 然 特 现 現 球 第 經 谁" + " 起 |" + " 例 別 别 制 动 動 吗 嗎" + " 增 指 明 朝 期 构 物 确" + " 种 調 调 費 费 那 都 間" + " 间" + +#endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */ + +#endif /* AF_CONFIG_OPTION_CJK */ + + +// The blue zone stringsets, as used in the script styles, cf. `afstyles.h'. +// +// The AF_BLUE_PROPERTY_XXX flags are defined in `afblue.h'; here some +// explanations. +// +// A blue zone in general is defined by a reference and an overshoot line. +// During the hinting process, all coordinate values between those two lines +// are set equal to the reference value, provided that the blue zone is not +// wider than 0.75 pixels (otherwise the blue zone gets ignored). All +// entries must have `AF_BLUE_STRING_MAX' as the final line. +// +// During the glyph analysis, edges are sorted from bottom to top, and then +// sequentially checked, edge by edge, against the blue zones in the order +// given below. +// +// +// latin auto-hinter +// ----------------- +// +// Characters in a blue string are automatically classified as having a flat +// (reference) or a round (overshoot) extremum. The blue zone is then set +// up by the mean values of all flat extrema and all round extrema, +// respectively. Only horizontal blue zones (i.e., adjusting vertical +// coordinate values) are supported. +// +// Some scripts like Khmer need character composition to get all necessary +// blue zones, since Unicode only provides an abstract data model that +// doesn't represent all possible glyph shapes. For such character +// clusters, the HarfBuzz library is used to convert them into the +// corresponding glyphs. The largest glyph element (where `largest' can be +// either `largest ascender' or `largest descender') then defines the +// corresponding flat or round extremum. +// +// For the latin auto-hinter, the overshoot should be larger than the +// reference for top zones, and vice versa for bottom zones. +// +// LATIN_TOP +// Take the maximum flat and round coordinate values of the blue string +// characters for computing the blue zone's reference and overshoot +// values. +// +// If not set, take the minimum values. +// +// Mutually exclusive with `LATIN_SUB_TOP'. +// +// LATIN_SUB_TOP +// For all glyphs of a character cluster, compute the maximum flat +// and round coordinate values of each component, then take the +// smallest of the maximum values. The idea is to get the top of +// subscript glyphs, as used in Khmer, for example. Note that +// this mechanism doesn't work for ordinary ligatures. +// +// This flags indicates a secondary blue zone: It gets removed if +// there is a non-LATIN_SUB_TOP blue zone at the same coordinate +// value (after scaling). +// +// Mutually exclusive with `LATIN_TOP'. +// +// LATIN_NEUTRAL +// Ignore round extrema and define the blue zone with flat values only. +// Both top and bottom of contours can match. This is useful for +// scripts like Devanagari where vowel signs attach to the base +// character and are implemented as components of composite glyphs. +// +// If not set, both round and flat extrema are taken into account. +// Additionally, only the top or the bottom of a contour can match, +// depending on the LATIN_TOP flag. +// +// Neutral blue zones should always follow non-neutral blue zones. +// +// LATIN_X_HEIGHT +// Scale all glyphs vertically from the corresponding script to make the +// reference line of this blue zone align on the grid. The scaling +// takes place before all other blue zones get aligned to the grid. +// Only one blue character string of a script style can have this flag. +// +// LATIN_LONG +// Apply an additional constraint for blue zone values: Don't +// necessarily use the extremum as-is but a segment of the topmost (or +// bottommost) contour that is longer than a heuristic threshold, and +// which is not too far away vertically from the real extremum. This +// ensures that small bumps in the outline are ignored (for example, the +// `vertical serifs' found in many Hebrew glyph designs). +// +// The segment must be at least EM/25 font units long, and the distance +// to the extremum must be smaller than EM/4. +// +// +// cjk auto-hinter +// --------------- +// +// Characters in a blue string are *not* automatically classified. Instead, +// first come the characters used for the overshoot value, then the +// character `|', then the characters used for the reference value +// (everything separated by space characters). The blue zone is then set up +// by the mean values of all reference values and all overshoot values, +// respectively. Both horizontal and vertical blue zones (i.e., adjusting +// vertical and horizontal coordinate values, respectively) are supported. +// +// For the cjk auto-hinter, the overshoot should be smaller than the +// reference for top zones, and vice versa for bottom zones. +// +// CJK_TOP +// Take the maximum flat and round coordinate values of the blue string +// characters. If not set, take the minimum values. +// +// CJK_RIGHT +// A synonym for CJK_TOP. If CJK_HORIZ is set, this flag indicates the +// right blue zone, taking horizontal maximum values. +// +// CJK_HORIZ +// Define a blue zone for horizontal hinting (i.e., vertical blue +// zones). If not set, this is a blue zone for vertical hinting. + + +AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN: + + AF_BLUE_STRINGSET_ADLM + { AF_BLUE_STRING_ADLAM_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_ADLAM_CAPITAL_BOTTOM, 0 } + { AF_BLUE_STRING_ADLAM_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_ADLAM_SMALL_BOTTOM, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_ARAB + { AF_BLUE_STRING_ARABIC_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_ARABIC_BOTTOM, 0 } + { AF_BLUE_STRING_ARABIC_JOIN, AF_BLUE_PROPERTY_LATIN_NEUTRAL } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_ARMN + { AF_BLUE_STRING_ARMENIAN_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_ARMENIAN_CAPITAL_BOTTOM, 0 } + { AF_BLUE_STRING_ARMENIAN_SMALL_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_ARMENIAN_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_ARMENIAN_SMALL_BOTTOM, 0 } + { AF_BLUE_STRING_ARMENIAN_SMALL_DESCENDER, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_AVST + { AF_BLUE_STRING_AVESTAN_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_AVESTAN_BOTTOM, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_BAMU + { AF_BLUE_STRING_BAMUM_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_BAMUM_BOTTOM, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_BENG + { AF_BLUE_STRING_BENGALI_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_BENGALI_HEAD, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_BENGALI_BASE, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_NEUTRAL | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_BENGALI_BASE, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_BUHD + { AF_BLUE_STRING_BUHID_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_BUHID_LARGE, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_BUHID_SMALL, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_BUHID_BOTTOM, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_CAKM + { AF_BLUE_STRING_CHAKMA_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_CHAKMA_BOTTOM, 0 } + { AF_BLUE_STRING_CHAKMA_DESCENDER, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_CANS + { AF_BLUE_STRING_CANADIAN_SYLLABICS_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_CANADIAN_SYLLABICS_BOTTOM, 0 } + { AF_BLUE_STRING_CANADIAN_SYLLABICS_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_CANADIAN_SYLLABICS_SMALL_BOTTOM, 0 } + { AF_BLUE_STRING_CANADIAN_SYLLABICS_SUPS_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_CANADIAN_SYLLABICS_SUPS_BOTTOM, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_CARI + { AF_BLUE_STRING_CARIAN_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_CARIAN_BOTTOM, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_CHER + { AF_BLUE_STRING_CHEROKEE_CAPITAL, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_CHEROKEE_CAPITAL, 0 } + { AF_BLUE_STRING_CHEROKEE_SMALL_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_CHEROKEE_SMALL, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_CHEROKEE_SMALL, 0 } + { AF_BLUE_STRING_CHEROKEE_SMALL_DESCENDER, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_COPT + { AF_BLUE_STRING_COPTIC_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_COPTIC_CAPITAL_BOTTOM, 0 } + { AF_BLUE_STRING_COPTIC_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_COPTIC_SMALL_BOTTOM, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_CPRT + { AF_BLUE_STRING_CYPRIOT_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_CYPRIOT_BOTTOM, 0 } + { AF_BLUE_STRING_CYPRIOT_SMALL, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_CYPRIOT_SMALL, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_CYRL + { AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM, 0 } + { AF_BLUE_STRING_CYRILLIC_SMALL, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_CYRILLIC_SMALL, 0 } + { AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_DEVA + { AF_BLUE_STRING_DEVANAGARI_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_DEVANAGARI_HEAD, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_DEVANAGARI_BASE, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_NEUTRAL | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_DEVANAGARI_BASE, 0 } + { AF_BLUE_STRING_DEVANAGARI_BOTTOM, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_DSRT + { AF_BLUE_STRING_DESERET_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_DESERET_CAPITAL_BOTTOM, 0 } + { AF_BLUE_STRING_DESERET_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_DESERET_SMALL_BOTTOM, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_ETHI + { AF_BLUE_STRING_ETHIOPIC_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_ETHIOPIC_BOTTOM, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_GEOR + { AF_BLUE_STRING_GEORGIAN_MKHEDRULI_TOP, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_GEORGIAN_MKHEDRULI_BOTTOM, 0 } + { AF_BLUE_STRING_GEORGIAN_MKHEDRULI_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_GEORGIAN_MKHEDRULI_DESCENDER, 0 } + { AF_BLUE_STRING_GEORGIAN_MTAVRULI_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_GEORGIAN_MTAVRULI_BOTTOM, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_GEOK + { AF_BLUE_STRING_GEORGIAN_ASOMTAVRULI_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_GEORGIAN_ASOMTAVRULI_BOTTOM, 0 } + { AF_BLUE_STRING_GEORGIAN_NUSKHURI_TOP, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_GEORGIAN_NUSKHURI_BOTTOM, 0 } + { AF_BLUE_STRING_GEORGIAN_NUSKHURI_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_GEORGIAN_NUSKHURI_DESCENDER, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_GLAG + { AF_BLUE_STRING_GLAGOLITIC_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_GLAGOLITIC_CAPITAL_BOTTOM, 0 } + { AF_BLUE_STRING_GLAGOLITIC_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_GLAGOLITIC_SMALL_BOTTOM, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_GOTH + { AF_BLUE_STRING_GOTHIC_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_GOTHIC_BOTTOM, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_GREK + { AF_BLUE_STRING_GREEK_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM, 0 } + { AF_BLUE_STRING_GREEK_SMALL_BETA_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_GREEK_SMALL, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_GREEK_SMALL, 0 } + { AF_BLUE_STRING_GREEK_SMALL_DESCENDER, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_GUJR + { AF_BLUE_STRING_GUJARATI_TOP, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_GUJARATI_BOTTOM, 0 } + { AF_BLUE_STRING_GUJARATI_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_GUJARATI_DESCENDER, 0 } + { AF_BLUE_STRING_GUJARATI_DIGIT_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_GURU + { AF_BLUE_STRING_GURMUKHI_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_GURMUKHI_HEAD, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_GURMUKHI_BASE, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_NEUTRAL | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_GURMUKHI_BOTTOM, 0 } + { AF_BLUE_STRING_GURMUKHI_DIGIT_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_HEBR + { AF_BLUE_STRING_HEBREW_TOP, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_LONG } + { AF_BLUE_STRING_HEBREW_BOTTOM, 0 } + { AF_BLUE_STRING_HEBREW_DESCENDER, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_KNDA + { AF_BLUE_STRING_KANNADA_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_KANNADA_BOTTOM, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_KALI + { AF_BLUE_STRING_KAYAH_LI_TOP, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_KAYAH_LI_BOTTOM, 0 } + { AF_BLUE_STRING_KAYAH_LI_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_KAYAH_LI_DESCENDER, 0 } + { AF_BLUE_STRING_KAYAH_LI_LARGE_DESCENDER, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_KHMR + { AF_BLUE_STRING_KHMER_TOP, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_KHMER_SUBSCRIPT_TOP, AF_BLUE_PROPERTY_LATIN_SUB_TOP } + { AF_BLUE_STRING_KHMER_BOTTOM, 0 } + { AF_BLUE_STRING_KHMER_DESCENDER, 0 } + { AF_BLUE_STRING_KHMER_LARGE_DESCENDER, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_KHMS + { AF_BLUE_STRING_KHMER_SYMBOLS_WAXING_TOP, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_KHMER_SYMBOLS_WANING_BOTTOM, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_LAO + { AF_BLUE_STRING_LAO_TOP, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_LAO_BOTTOM, 0 } + { AF_BLUE_STRING_LAO_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_LAO_LARGE_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_LAO_DESCENDER, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_LATN + { AF_BLUE_STRING_LATIN_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM, 0 } + { AF_BLUE_STRING_LATIN_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_LATIN_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_LATIN_SMALL_BOTTOM, 0 } + { AF_BLUE_STRING_LATIN_SMALL_DESCENDER, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_LATB + { AF_BLUE_STRING_LATIN_SUBS_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_LATIN_SUBS_CAPITAL_BOTTOM, 0 } + { AF_BLUE_STRING_LATIN_SUBS_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_LATIN_SUBS_SMALL, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_LATIN_SUBS_SMALL, 0 } + { AF_BLUE_STRING_LATIN_SUBS_SMALL_DESCENDER, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_LATP + { AF_BLUE_STRING_LATIN_SUPS_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_LATIN_SUPS_CAPITAL_BOTTOM, 0 } + { AF_BLUE_STRING_LATIN_SUPS_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_LATIN_SUPS_SMALL, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_LATIN_SUPS_SMALL, 0 } + { AF_BLUE_STRING_LATIN_SUPS_SMALL_DESCENDER, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_LISU + { AF_BLUE_STRING_LISU_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_LISU_BOTTOM, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_MLYM + { AF_BLUE_STRING_MALAYALAM_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_MALAYALAM_BOTTOM, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_MEDF + { AF_BLUE_STRING_MEDEFAIDRIN_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_MEDEFAIDRIN_CAPITAL_BOTTOM, 0 } + { AF_BLUE_STRING_MEDEFAIDRIN_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_MEDEFAIDRIN_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_MEDEFAIDRIN_SMALL_BOTTOM, 0 } + { AF_BLUE_STRING_MEDEFAIDRIN_SMALL_DESCENDER, 0 } + { AF_BLUE_STRING_MEDEFAIDRIN_DIGIT_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_MONG + { AF_BLUE_STRING_MONGOLIAN_TOP_BASE, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_MONGOLIAN_BOTTOM_BASE, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_MYMR + { AF_BLUE_STRING_MYANMAR_TOP, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_MYANMAR_BOTTOM, 0 } + { AF_BLUE_STRING_MYANMAR_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_MYANMAR_DESCENDER, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_NKOO + { AF_BLUE_STRING_NKO_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_NKO_BOTTOM, 0 } + { AF_BLUE_STRING_NKO_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_NKO_SMALL_BOTTOM, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_NONE + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_OLCK + { AF_BLUE_STRING_OL_CHIKI, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_OL_CHIKI, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_ORKH + { AF_BLUE_STRING_OLD_TURKIC_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_OLD_TURKIC_BOTTOM, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_OSGE + { AF_BLUE_STRING_OSAGE_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_OSAGE_CAPITAL_BOTTOM, 0 } + { AF_BLUE_STRING_OSAGE_CAPITAL_DESCENDER, 0 } + { AF_BLUE_STRING_OSAGE_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_OSAGE_SMALL_BOTTOM, 0 } + { AF_BLUE_STRING_OSAGE_SMALL_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_OSAGE_SMALL_DESCENDER, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_OSMA + { AF_BLUE_STRING_OSMANYA_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_OSMANYA_BOTTOM, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_ROHG + { AF_BLUE_STRING_ROHINGYA_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_ROHINGYA_BOTTOM, 0 } + { AF_BLUE_STRING_ROHINGYA_JOIN, AF_BLUE_PROPERTY_LATIN_NEUTRAL } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_SAUR + { AF_BLUE_STRING_SAURASHTRA_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_SAURASHTRA_BOTTOM, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_SHAW + { AF_BLUE_STRING_SHAVIAN_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_SHAVIAN_BOTTOM, 0 } + { AF_BLUE_STRING_SHAVIAN_DESCENDER, 0 } + { AF_BLUE_STRING_SHAVIAN_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_SHAVIAN_SMALL_BOTTOM, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_SINH + { AF_BLUE_STRING_SINHALA_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_SINHALA_BOTTOM, 0 } + { AF_BLUE_STRING_SINHALA_DESCENDER, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_SUND + { AF_BLUE_STRING_SUNDANESE_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_SUNDANESE_BOTTOM, 0 } + { AF_BLUE_STRING_SUNDANESE_DESCENDER, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_TAML + { AF_BLUE_STRING_TAMIL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_TAMIL_BOTTOM, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_TAVT + { AF_BLUE_STRING_TAI_VIET_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_TAI_VIET_BOTTOM, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_TELU + { AF_BLUE_STRING_TELUGU_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_TELUGU_BOTTOM, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_THAI + { AF_BLUE_STRING_THAI_TOP, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_THAI_BOTTOM, 0 } + { AF_BLUE_STRING_THAI_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_THAI_LARGE_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_THAI_DESCENDER, 0 } + { AF_BLUE_STRING_THAI_LARGE_DESCENDER, 0 } + { AF_BLUE_STRING_THAI_DIGIT_TOP, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_TFNG + { AF_BLUE_STRING_TIFINAGH, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_TIFINAGH, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_VAII + { AF_BLUE_STRING_VAI_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_VAI_BOTTOM, 0 } + { AF_BLUE_STRING_MAX, 0 } + +#ifdef AF_CONFIG_OPTION_CJK + + AF_BLUE_STRINGSET_HANI + { AF_BLUE_STRING_CJK_TOP, AF_BLUE_PROPERTY_CJK_TOP } + { AF_BLUE_STRING_CJK_BOTTOM, 0 } +#ifdef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT + { AF_BLUE_STRING_CJK_LEFT, AF_BLUE_PROPERTY_CJK_HORIZ } + { AF_BLUE_STRING_CJK_RIGHT, AF_BLUE_PROPERTY_CJK_HORIZ | + AF_BLUE_PROPERTY_CJK_RIGHT } +#endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */ + { AF_BLUE_STRING_MAX, 0 } + +#endif /* AF_CONFIG_OPTION_CJK */ + + +// END diff --git a/vendor/freetype/src/autofit/afblue.h b/vendor/freetype/src/autofit/afblue.h index 76f2f47cb0..2aa9d0984e 100644 --- a/vendor/freetype/src/autofit/afblue.h +++ b/vendor/freetype/src/autofit/afblue.h @@ -7,7 +7,7 @@ * * Auto-fitter data for blue strings (specification). * - * Copyright (C) 2013-2023 by + * Copyright (C) 2013-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/autofit/afblue.hin b/vendor/freetype/src/autofit/afblue.hin index 6a31298e65..38031505a8 100644 --- a/vendor/freetype/src/autofit/afblue.hin +++ b/vendor/freetype/src/autofit/afblue.hin @@ -4,7 +4,7 @@ * * Auto-fitter data for blue strings (specification). * - * Copyright (C) 2013-2023 by + * Copyright (C) 2013-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/autofit/afcjk.c b/vendor/freetype/src/autofit/afcjk.c index f414289adc..869b60487c 100644 --- a/vendor/freetype/src/autofit/afcjk.c +++ b/vendor/freetype/src/autofit/afcjk.c @@ -4,7 +4,7 @@ * * Auto-fitter hinting routines for CJK writing system (body). * - * Copyright (C) 2006-2023 by + * Copyright (C) 2006-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/autofit/afcjk.h b/vendor/freetype/src/autofit/afcjk.h index f380ef6e03..bc5aaf12e6 100644 --- a/vendor/freetype/src/autofit/afcjk.h +++ b/vendor/freetype/src/autofit/afcjk.h @@ -4,7 +4,7 @@ * * Auto-fitter hinting routines for CJK writing system (specification). * - * Copyright (C) 2006-2023 by + * Copyright (C) 2006-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -84,7 +84,7 @@ FT_BEGIN_HEADER /* used for horizontal metrics too for CJK */ FT_Bool control_overshoot; FT_UInt blue_count; - AF_CJKBlueRec blues[AF_BLUE_STRINGSET_MAX]; + AF_CJKBlueRec blues[AF_BLUE_STRINGSET_MAX_LEN]; FT_Fixed org_scale; FT_Pos org_delta; diff --git a/vendor/freetype/src/autofit/afcover.h b/vendor/freetype/src/autofit/afcover.h index 102ed42782..7980cf2e97 100644 --- a/vendor/freetype/src/autofit/afcover.h +++ b/vendor/freetype/src/autofit/afcover.h @@ -4,7 +4,7 @@ * * Auto-fitter coverages (specification only). * - * Copyright (C) 2013-2023 by + * Copyright (C) 2013-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/autofit/afdummy.c b/vendor/freetype/src/autofit/afdummy.c index a4629b528d..ad667d2edc 100644 --- a/vendor/freetype/src/autofit/afdummy.c +++ b/vendor/freetype/src/autofit/afdummy.c @@ -5,7 +5,7 @@ * Auto-fitter dummy routines to be used if no hinting should be * performed (body). * - * Copyright (C) 2003-2023 by + * Copyright (C) 2003-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/autofit/afdummy.h b/vendor/freetype/src/autofit/afdummy.h index a7af3f62c9..613c2f88a3 100644 --- a/vendor/freetype/src/autofit/afdummy.h +++ b/vendor/freetype/src/autofit/afdummy.h @@ -5,7 +5,7 @@ * Auto-fitter dummy routines to be used if no hinting should be * performed (specification). * - * Copyright (C) 2003-2023 by + * Copyright (C) 2003-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/autofit/aferrors.h b/vendor/freetype/src/autofit/aferrors.h index 88faf05c95..ae584ff06d 100644 --- a/vendor/freetype/src/autofit/aferrors.h +++ b/vendor/freetype/src/autofit/aferrors.h @@ -4,7 +4,7 @@ * * Autofitter error codes (specification only). * - * Copyright (C) 2005-2023 by + * Copyright (C) 2005-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/autofit/afglobal.c b/vendor/freetype/src/autofit/afglobal.c index b1957570f0..b7403fa65e 100644 --- a/vendor/freetype/src/autofit/afglobal.c +++ b/vendor/freetype/src/autofit/afglobal.c @@ -4,7 +4,7 @@ * * Auto-fitter routines to compute global hinting values (body). * - * Copyright (C) 2003-2023 by + * Copyright (C) 2003-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/autofit/afglobal.h b/vendor/freetype/src/autofit/afglobal.h index 66170e419d..ddb54c89b2 100644 --- a/vendor/freetype/src/autofit/afglobal.h +++ b/vendor/freetype/src/autofit/afglobal.h @@ -5,7 +5,7 @@ * Auto-fitter routines to compute global hinting values * (specification). * - * Copyright (C) 2003-2023 by + * Copyright (C) 2003-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/autofit/afhints.c b/vendor/freetype/src/autofit/afhints.c index e4a378fbf7..96ffe343aa 100644 --- a/vendor/freetype/src/autofit/afhints.c +++ b/vendor/freetype/src/autofit/afhints.c @@ -4,7 +4,7 @@ * * Auto-fitter hinting routines (body). * - * Copyright (C) 2003-2023 by + * Copyright (C) 2003-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -979,8 +979,8 @@ /* compute coordinates & Bezier flags, next and prev */ { FT_Vector* vec = outline->points; - char* tag = outline->tags; - FT_Short endpoint = outline->contours[0]; + FT_Byte* tag = outline->tags; + FT_UShort endpoint = outline->contours[0]; AF_Point end = points + endpoint; AF_Point prev = end; FT_Int contour_index = 0; @@ -1046,16 +1046,16 @@ /* set up the contours array */ { - AF_Point* contour = hints->contours; - AF_Point* contour_limit = contour + hints->num_contours; - short* end = outline->contours; - short idx = 0; + AF_Point* contour = hints->contours; + AF_Point* contour_limit = contour + hints->num_contours; + FT_UShort* end = outline->contours; + FT_Int idx = 0; for ( ; contour < contour_limit; contour++, end++ ) { contour[0] = points + idx; - idx = (short)( end[0] + 1 ); + idx = *end + 1; } } @@ -1292,7 +1292,7 @@ AF_Point point = hints->points; AF_Point limit = point + hints->num_points; FT_Vector* vec = outline->points; - char* tag = outline->tags; + FT_Byte* tag = outline->tags; for ( ; point < limit; point++, vec++, tag++ ) diff --git a/vendor/freetype/src/autofit/afhints.h b/vendor/freetype/src/autofit/afhints.h index d1cf9529bf..76fe83006a 100644 --- a/vendor/freetype/src/autofit/afhints.h +++ b/vendor/freetype/src/autofit/afhints.h @@ -4,7 +4,7 @@ * * Auto-fitter hinting routines (specification). * - * Copyright (C) 2003-2023 by + * Copyright (C) 2003-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/autofit/afindic.c b/vendor/freetype/src/autofit/afindic.c index 7fb12c63d5..c6d23efd86 100644 --- a/vendor/freetype/src/autofit/afindic.c +++ b/vendor/freetype/src/autofit/afindic.c @@ -4,7 +4,7 @@ * * Auto-fitter hinting routines for Indic writing system (body). * - * Copyright (C) 2007-2023 by + * Copyright (C) 2007-2024 by * Rahul Bhalerao , . * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/autofit/afindic.h b/vendor/freetype/src/autofit/afindic.h index 3eb67f63b0..a7f73f2515 100644 --- a/vendor/freetype/src/autofit/afindic.h +++ b/vendor/freetype/src/autofit/afindic.h @@ -5,7 +5,7 @@ * Auto-fitter hinting routines for Indic writing system * (specification). * - * Copyright (C) 2007-2023 by + * Copyright (C) 2007-2024 by * Rahul Bhalerao , . * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/autofit/aflatin.c b/vendor/freetype/src/autofit/aflatin.c index b86367aa94..89287f7ea5 100644 --- a/vendor/freetype/src/autofit/aflatin.c +++ b/vendor/freetype/src/autofit/aflatin.c @@ -4,7 +4,7 @@ * * Auto-fitter hinting routines for latin writing system (body). * - * Copyright (C) 2003-2023 by + * Copyright (C) 2003-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -981,7 +981,7 @@ /* `ref' and `shoot' values of two blue zones must not overlap */ FT_UInt i; - AF_LatinBlue blue_sorted[AF_BLUE_STRINGSET_MAX_LEN + 2]; + AF_LatinBlue blue_sorted[AF_BLUE_STRINGSET_MAX_LEN]; for ( i = 0; i < axis->blue_count; i++ ) @@ -1263,10 +1263,9 @@ max_height = FT_MAX( max_height, -Axis->blues[nn].descender ); } - dist = FT_ABS( FT_MulFix( max_height, new_scale - scale ) ); - dist &= ~127; + dist = FT_MulFix( max_height, new_scale - scale ); - if ( dist == 0 ) + if ( -128 < dist && dist < 128 ) { FT_TRACE5(( "af_latin_metrics_scale_dim:" " x height alignment (style `%s'):\n", diff --git a/vendor/freetype/src/autofit/aflatin.h b/vendor/freetype/src/autofit/aflatin.h index 31aa91d3bd..54e5061502 100644 --- a/vendor/freetype/src/autofit/aflatin.h +++ b/vendor/freetype/src/autofit/aflatin.h @@ -5,7 +5,7 @@ * Auto-fitter hinting routines for latin writing system * (specification). * - * Copyright (C) 2003-2023 by + * Copyright (C) 2003-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -98,7 +98,7 @@ FT_BEGIN_HEADER /* ignored for horizontal metrics */ FT_UInt blue_count; - AF_LatinBlueRec blues[AF_BLUE_STRINGSET_MAX]; + AF_LatinBlueRec blues[AF_BLUE_STRINGSET_MAX_LEN]; FT_Fixed org_scale; FT_Pos org_delta; diff --git a/vendor/freetype/src/autofit/afloader.c b/vendor/freetype/src/autofit/afloader.c index 7c47d562af..af1d59a689 100644 --- a/vendor/freetype/src/autofit/afloader.c +++ b/vendor/freetype/src/autofit/afloader.c @@ -4,7 +4,7 @@ * * Auto-fitter glyph loading routines (body). * - * Copyright (C) 2003-2023 by + * Copyright (C) 2003-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/autofit/afloader.h b/vendor/freetype/src/autofit/afloader.h index e4e197e374..99f0e15f92 100644 --- a/vendor/freetype/src/autofit/afloader.h +++ b/vendor/freetype/src/autofit/afloader.h @@ -4,7 +4,7 @@ * * Auto-fitter glyph loading routines (specification). * - * Copyright (C) 2003-2023 by + * Copyright (C) 2003-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/autofit/afmodule.c b/vendor/freetype/src/autofit/afmodule.c index 20a6b96bc4..8b0123b3e3 100644 --- a/vendor/freetype/src/autofit/afmodule.c +++ b/vendor/freetype/src/autofit/afmodule.c @@ -4,7 +4,7 @@ * * Auto-fitter module implementation (body). * - * Copyright (C) 2003-2023 by + * Copyright (C) 2003-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/autofit/afmodule.h b/vendor/freetype/src/autofit/afmodule.h index 4b8b4562c6..91a1abfef1 100644 --- a/vendor/freetype/src/autofit/afmodule.h +++ b/vendor/freetype/src/autofit/afmodule.h @@ -4,7 +4,7 @@ * * Auto-fitter module implementation (specification). * - * Copyright (C) 2003-2023 by + * Copyright (C) 2003-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/autofit/afranges.c b/vendor/freetype/src/autofit/afranges.c index cfcaf340a7..007b432818 100644 --- a/vendor/freetype/src/autofit/afranges.c +++ b/vendor/freetype/src/autofit/afranges.c @@ -4,7 +4,7 @@ * * Auto-fitter Unicode script ranges (body). * - * Copyright (C) 2013-2023 by + * Copyright (C) 2013-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/autofit/afranges.h b/vendor/freetype/src/autofit/afranges.h index 5775738bc0..813b3ee78e 100644 --- a/vendor/freetype/src/autofit/afranges.h +++ b/vendor/freetype/src/autofit/afranges.h @@ -4,7 +4,7 @@ * * Auto-fitter Unicode script ranges (specification). * - * Copyright (C) 2013-2023 by + * Copyright (C) 2013-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/autofit/afscript.h b/vendor/freetype/src/autofit/afscript.h index 3a101937d7..0a83d77150 100644 --- a/vendor/freetype/src/autofit/afscript.h +++ b/vendor/freetype/src/autofit/afscript.h @@ -4,7 +4,7 @@ * * Auto-fitter scripts (specification only). * - * Copyright (C) 2013-2023 by + * Copyright (C) 2013-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/autofit/afshaper.c b/vendor/freetype/src/autofit/afshaper.c index abc6f1d292..df0f46ada8 100644 --- a/vendor/freetype/src/autofit/afshaper.c +++ b/vendor/freetype/src/autofit/afshaper.c @@ -4,7 +4,7 @@ * * HarfBuzz interface for accessing OpenType features (body). * - * Copyright (C) 2013-2023 by + * Copyright (C) 2013-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/autofit/afshaper.h b/vendor/freetype/src/autofit/afshaper.h index 054a18ffbc..2eb03bb5d9 100644 --- a/vendor/freetype/src/autofit/afshaper.h +++ b/vendor/freetype/src/autofit/afshaper.h @@ -4,7 +4,7 @@ * * HarfBuzz interface for accessing OpenType features (specification). * - * Copyright (C) 2013-2023 by + * Copyright (C) 2013-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/autofit/afstyles.h b/vendor/freetype/src/autofit/afstyles.h index 73ebef0171..7a33f37a85 100644 --- a/vendor/freetype/src/autofit/afstyles.h +++ b/vendor/freetype/src/autofit/afstyles.h @@ -4,7 +4,7 @@ * * Auto-fitter styles (specification only). * - * Copyright (C) 2013-2023 by + * Copyright (C) 2013-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/autofit/aftypes.h b/vendor/freetype/src/autofit/aftypes.h index 6615194496..27e4185e9f 100644 --- a/vendor/freetype/src/autofit/aftypes.h +++ b/vendor/freetype/src/autofit/aftypes.h @@ -4,7 +4,7 @@ * * Auto-fitter types (specification only). * - * Copyright (C) 2003-2023 by + * Copyright (C) 2003-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/autofit/afws-decl.h b/vendor/freetype/src/autofit/afws-decl.h index 48c888afed..b78745af74 100644 --- a/vendor/freetype/src/autofit/afws-decl.h +++ b/vendor/freetype/src/autofit/afws-decl.h @@ -4,7 +4,7 @@ * * Auto-fitter writing system declarations (specification only). * - * Copyright (C) 2013-2023 by + * Copyright (C) 2013-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/autofit/afws-iter.h b/vendor/freetype/src/autofit/afws-iter.h index a0a686f8ce..c86d609a35 100644 --- a/vendor/freetype/src/autofit/afws-iter.h +++ b/vendor/freetype/src/autofit/afws-iter.h @@ -4,7 +4,7 @@ * * Auto-fitter writing systems iterator (specification only). * - * Copyright (C) 2013-2023 by + * Copyright (C) 2013-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/autofit/autofit.c b/vendor/freetype/src/autofit/autofit.c index 8bd609b5e8..de5ec7c7c5 100644 --- a/vendor/freetype/src/autofit/autofit.c +++ b/vendor/freetype/src/autofit/autofit.c @@ -4,7 +4,7 @@ * * Auto-fitter module (body). * - * Copyright (C) 2003-2023 by + * Copyright (C) 2003-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/base/ftadvanc.c b/vendor/freetype/src/base/ftadvanc.c index de25476fe9..717f7d08b3 100644 --- a/vendor/freetype/src/base/ftadvanc.c +++ b/vendor/freetype/src/base/ftadvanc.c @@ -4,7 +4,7 @@ * * Quick computation of advance widths (body). * - * Copyright (C) 2008-2023 by + * Copyright (C) 2008-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/base/ftbase.c b/vendor/freetype/src/base/ftbase.c index 156510f007..50805ccec4 100644 --- a/vendor/freetype/src/base/ftbase.c +++ b/vendor/freetype/src/base/ftbase.c @@ -4,7 +4,7 @@ * * Single object library component (body only). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/base/ftbase.h b/vendor/freetype/src/base/ftbase.h index 00790d3b22..1d98b26dd5 100644 --- a/vendor/freetype/src/base/ftbase.h +++ b/vendor/freetype/src/base/ftbase.h @@ -4,7 +4,7 @@ * * Private functions used in the `base' module (specification). * - * Copyright (C) 2008-2023 by + * Copyright (C) 2008-2024 by * David Turner, Robert Wilhelm, Werner Lemberg, and suzuki toshiya. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/base/ftbbox.c b/vendor/freetype/src/base/ftbbox.c index 385fea4040..d6aa5d56df 100644 --- a/vendor/freetype/src/base/ftbbox.c +++ b/vendor/freetype/src/base/ftbbox.c @@ -4,7 +4,7 @@ * * FreeType bbox computation (body). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used @@ -489,7 +489,7 @@ return FT_THROW( Invalid_Outline ); /* if outline is empty, return (0,0,0,0) */ - if ( outline->n_points == 0 || outline->n_contours <= 0 ) + if ( outline->n_points == 0 || outline->n_contours == 0 ) { abbox->xMin = abbox->xMax = 0; abbox->yMin = abbox->yMax = 0; diff --git a/vendor/freetype/src/base/ftbdf.c b/vendor/freetype/src/base/ftbdf.c index f697c00fec..d8e9fd7eaf 100644 --- a/vendor/freetype/src/base/ftbdf.c +++ b/vendor/freetype/src/base/ftbdf.c @@ -4,7 +4,7 @@ * * FreeType API for accessing BDF-specific strings (body). * - * Copyright (C) 2002-2023 by + * Copyright (C) 2002-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/base/ftbitmap.c b/vendor/freetype/src/base/ftbitmap.c index 1c93648dcb..4be145679f 100644 --- a/vendor/freetype/src/base/ftbitmap.c +++ b/vendor/freetype/src/base/ftbitmap.c @@ -4,7 +4,7 @@ * * FreeType utility functions for bitmaps (body). * - * Copyright (C) 2004-2023 by + * Copyright (C) 2004-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/base/ftcalc.c b/vendor/freetype/src/base/ftcalc.c index c5bc7e3b14..5851dae162 100644 --- a/vendor/freetype/src/base/ftcalc.c +++ b/vendor/freetype/src/base/ftcalc.c @@ -4,7 +4,7 @@ * * Arithmetic computations (body). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -69,13 +69,15 @@ /* transfer sign, leaving a positive number; */ /* we need an unsigned value to safely negate INT_MIN (or LONG_MIN) */ -#define FT_MOVE_SIGN( x, x_unsigned, s ) \ - FT_BEGIN_STMNT \ - if ( x < 0 ) \ - { \ - x_unsigned = 0U - (x_unsigned); \ - s = -s; \ - } \ +#define FT_MOVE_SIGN( utype, x, x_unsigned, s ) \ + FT_BEGIN_STMNT \ + if ( x < 0 ) \ + { \ + x_unsigned = 0U - (utype)x; \ + s = -s; \ + } \ + else \ + x_unsigned = (utype)x; \ FT_END_STMNT /* The following three functions are available regardless of whether */ @@ -179,13 +181,9 @@ FT_Long d_; - a = (FT_UInt64)a_; - b = (FT_UInt64)b_; - c = (FT_UInt64)c_; - - FT_MOVE_SIGN( a_, a, s ); - FT_MOVE_SIGN( b_, b, s ); - FT_MOVE_SIGN( c_, c, s ); + FT_MOVE_SIGN( FT_UInt64, a_, a, s ); + FT_MOVE_SIGN( FT_UInt64, b_, b, s ); + FT_MOVE_SIGN( FT_UInt64, c_, c, s ); d = c > 0 ? ( a * b + ( c >> 1 ) ) / c : 0x7FFFFFFFUL; @@ -208,13 +206,9 @@ FT_Long d_; - a = (FT_UInt64)a_; - b = (FT_UInt64)b_; - c = (FT_UInt64)c_; - - FT_MOVE_SIGN( a_, a, s ); - FT_MOVE_SIGN( b_, b, s ); - FT_MOVE_SIGN( c_, c, s ); + FT_MOVE_SIGN( FT_UInt64, a_, a, s ); + FT_MOVE_SIGN( FT_UInt64, b_, b, s ); + FT_MOVE_SIGN( FT_UInt64, c_, c, s ); d = c > 0 ? a * b / c : 0x7FFFFFFFUL; @@ -257,11 +251,8 @@ FT_Long q_; - a = (FT_UInt64)a_; - b = (FT_UInt64)b_; - - FT_MOVE_SIGN( a_, a, s ); - FT_MOVE_SIGN( b_, b, s ); + FT_MOVE_SIGN( FT_UInt64, a_, a, s ); + FT_MOVE_SIGN( FT_UInt64, b_, b, s ); q = b > 0 ? ( ( a << 16 ) + ( b >> 1 ) ) / b : 0x7FFFFFFFUL; @@ -422,13 +413,9 @@ /* XXX: this function does not allow 64-bit arguments */ - a = (FT_UInt32)a_; - b = (FT_UInt32)b_; - c = (FT_UInt32)c_; - - FT_MOVE_SIGN( a_, a, s ); - FT_MOVE_SIGN( b_, b, s ); - FT_MOVE_SIGN( c_, c, s ); + FT_MOVE_SIGN( FT_UInt32, a_, a, s ); + FT_MOVE_SIGN( FT_UInt32, b_, b, s ); + FT_MOVE_SIGN( FT_UInt32, c_, c, s ); if ( c == 0 ) a = 0x7FFFFFFFUL; @@ -470,13 +457,9 @@ /* XXX: this function does not allow 64-bit arguments */ - a = (FT_UInt32)a_; - b = (FT_UInt32)b_; - c = (FT_UInt32)c_; - - FT_MOVE_SIGN( a_, a, s ); - FT_MOVE_SIGN( b_, b, s ); - FT_MOVE_SIGN( c_, c, s ); + FT_MOVE_SIGN( FT_UInt32, a_, a, s ); + FT_MOVE_SIGN( FT_UInt32, b_, b, s ); + FT_MOVE_SIGN( FT_UInt32, c_, c, s ); if ( c == 0 ) a = 0x7FFFFFFFUL; @@ -575,11 +558,8 @@ /* XXX: this function does not allow 64-bit arguments */ - a = (FT_UInt32)a_; - b = (FT_UInt32)b_; - - FT_MOVE_SIGN( a_, a, s ); - FT_MOVE_SIGN( b_, b, s ); + FT_MOVE_SIGN( FT_UInt32, a_, a, s ); + FT_MOVE_SIGN( FT_UInt32, b_, b, s ); if ( a + ( b >> 8 ) <= 8190UL ) a = ( a * b + 0x8000UL ) >> 16; @@ -614,11 +594,8 @@ /* XXX: this function does not allow 64-bit arguments */ - a = (FT_UInt32)a_; - b = (FT_UInt32)b_; - - FT_MOVE_SIGN( a_, a, s ); - FT_MOVE_SIGN( b_, b, s ); + FT_MOVE_SIGN( FT_UInt32, a_, a, s ); + FT_MOVE_SIGN( FT_UInt32, b_, b, s ); if ( b == 0 ) { @@ -829,11 +806,8 @@ FT_Int sx = 1, sy = 1, shift; - x = (FT_UInt32)x_; - y = (FT_UInt32)y_; - - FT_MOVE_SIGN( x_, x, sx ); - FT_MOVE_SIGN( y_, y, sy ); + FT_MOVE_SIGN( FT_UInt32, x_, x, sx ); + FT_MOVE_SIGN( FT_UInt32, y_, y, sy ); /* trivial cases */ if ( x == 0 ) @@ -913,43 +887,71 @@ } -#if 0 - /* documentation is in ftcalc.h */ - FT_BASE_DEF( FT_Int32 ) - FT_SqrtFixed( FT_Int32 x ) + FT_BASE_DEF( FT_UInt32 ) + FT_SqrtFixed( FT_UInt32 v ) { - FT_UInt32 root, rem_hi, rem_lo, test_div; - FT_Int count; - + if ( v == 0 ) + return 0; - root = 0; +#ifndef FT_INT64 - if ( x > 0 ) + /* Algorithm by Christophe Meessen (1993) with overflow fixed and */ + /* rounding added. Any unsigned fixed 16.16 argument is acceptable. */ + /* However, this algorithm is slower than the Babylonian method with */ + /* a good initial guess. We only use it for large 32-bit values when */ + /* 64-bit computations are not desirable. */ + else if ( v > 0x10000U ) { - rem_hi = 0; - rem_lo = (FT_UInt32)x; - count = 24; + FT_UInt32 r = v >> 1; + FT_UInt32 q = ( v & 1 ) << 15; + FT_UInt32 b = 0x20000000; + FT_UInt32 t; + + do { - rem_hi = ( rem_hi << 2 ) | ( rem_lo >> 30 ); - rem_lo <<= 2; - root <<= 1; - test_div = ( root << 1 ) + 1; - - if ( rem_hi >= test_div ) + t = q + b; + if ( r >= t ) { - rem_hi -= test_div; - root += 1; + r -= t; + q = t + b; /* equivalent to q += 2*b */ } - } while ( --count ); + r <<= 1; + b >>= 1; + } + while ( b > 0x10 ); /* exactly 25 cycles */ + + return ( q + 0x40 ) >> 7; } + else + { + FT_UInt32 r = ( v << 16 ) - 1; - return (FT_Int32)root; - } +#else /* FT_INT64 */ -#endif /* 0 */ + else + { + FT_UInt64 r = ( (FT_UInt64)v << 16 ) - 1; + +#endif /* FT_INT64 */ + + FT_UInt32 q = 1 << ( ( 17 + FT_MSB( v ) ) >> 1 ); + FT_UInt32 t; + + + /* Babylonian method with rounded-up division */ + do + { + t = q; + q = ( t + (FT_UInt32)( r / t ) + 1 ) >> 1; + } + while ( q != t ); /* less than 6 cycles */ + + return q; + } + } /* documentation is in ftcalc.h */ @@ -1094,11 +1096,8 @@ FT_UInt32 factor; - scalar = (FT_UInt32)s[i]; - factor = (FT_UInt32)f[i]; - - FT_MOVE_SIGN( s[i], scalar, sign ); - FT_MOVE_SIGN( f[i], factor, sign ); + FT_MOVE_SIGN( FT_UInt32, s[i], scalar, sign ); + FT_MOVE_SIGN( FT_UInt32, f[i], factor, sign ); ft_multo64( scalar, factor, &multResult ); diff --git a/vendor/freetype/src/base/ftcid.c b/vendor/freetype/src/base/ftcid.c index 866cd23e91..4f2deb19a0 100644 --- a/vendor/freetype/src/base/ftcid.c +++ b/vendor/freetype/src/base/ftcid.c @@ -4,7 +4,7 @@ * * FreeType API for accessing CID font information. * - * Copyright (C) 2007-2023 by + * Copyright (C) 2007-2024 by * Derek Clegg and Michael Toftdal. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/base/ftcolor.c b/vendor/freetype/src/base/ftcolor.c index bcd6e893d4..c6bf2a3cd1 100644 --- a/vendor/freetype/src/base/ftcolor.c +++ b/vendor/freetype/src/base/ftcolor.c @@ -4,7 +4,7 @@ * * FreeType's glyph color management (body). * - * Copyright (C) 2018-2023 by + * Copyright (C) 2018-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/base/ftdbgmem.c b/vendor/freetype/src/base/ftdbgmem.c index 8fab50dd01..902a5dc8bb 100644 --- a/vendor/freetype/src/base/ftdbgmem.c +++ b/vendor/freetype/src/base/ftdbgmem.c @@ -4,7 +4,7 @@ * * Memory debugger (body). * - * Copyright (C) 2001-2023 by + * Copyright (C) 2001-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/base/ftdebug.c b/vendor/freetype/src/base/ftdebug.c index 61c4563b0c..11307eaace 100644 --- a/vendor/freetype/src/base/ftdebug.c +++ b/vendor/freetype/src/base/ftdebug.c @@ -4,7 +4,7 @@ * * Debugging and logging component (body). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/base/fterrors.c b/vendor/freetype/src/base/fterrors.c index 5ad9709c80..61041a37c1 100644 --- a/vendor/freetype/src/base/fterrors.c +++ b/vendor/freetype/src/base/fterrors.c @@ -4,7 +4,7 @@ * * FreeType API for error code handling. * - * Copyright (C) 2018-2023 by + * Copyright (C) 2018-2024 by * Armin Hasitzka, David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/base/ftfntfmt.c b/vendor/freetype/src/base/ftfntfmt.c index 0b41f7cc83..77b4089e7e 100644 --- a/vendor/freetype/src/base/ftfntfmt.c +++ b/vendor/freetype/src/base/ftfntfmt.c @@ -4,7 +4,7 @@ * * FreeType utility file for font formats (body). * - * Copyright (C) 2002-2023 by + * Copyright (C) 2002-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/base/ftfstype.c b/vendor/freetype/src/base/ftfstype.c index ea24e64c6e..1565c3b7e2 100644 --- a/vendor/freetype/src/base/ftfstype.c +++ b/vendor/freetype/src/base/ftfstype.c @@ -4,7 +4,7 @@ * * FreeType utility file to access FSType data (body). * - * Copyright (C) 2008-2023 by + * Copyright (C) 2008-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/base/ftgasp.c b/vendor/freetype/src/base/ftgasp.c index 29b7b08b78..c63d30e978 100644 --- a/vendor/freetype/src/base/ftgasp.c +++ b/vendor/freetype/src/base/ftgasp.c @@ -4,7 +4,7 @@ * * Access of TrueType's `gasp' table (body). * - * Copyright (C) 2007-2023 by + * Copyright (C) 2007-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/base/ftgloadr.c b/vendor/freetype/src/base/ftgloadr.c index 9823d09e41..484d98f172 100644 --- a/vendor/freetype/src/base/ftgloadr.c +++ b/vendor/freetype/src/base/ftgloadr.c @@ -4,7 +4,7 @@ * * The FreeType glyph loader (body). * - * Copyright (C) 2002-2023 by + * Copyright (C) 2002-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg * * This file is part of the FreeType project, and may only be used, @@ -355,34 +355,25 @@ FT_BASE_DEF( void ) FT_GlyphLoader_Add( FT_GlyphLoader loader ) { - FT_GlyphLoad base; - FT_GlyphLoad current; - - FT_Int n_curr_contours; - FT_Int n_base_points; - FT_Int n; + FT_Outline* base; + FT_Outline* current; + FT_Int n; if ( !loader ) return; - base = &loader->base; - current = &loader->current; - - n_curr_contours = current->outline.n_contours; - n_base_points = base->outline.n_points; + base = &loader->base.outline; + current = &loader->current.outline; - base->outline.n_points = - (short)( base->outline.n_points + current->outline.n_points ); - base->outline.n_contours = - (short)( base->outline.n_contours + current->outline.n_contours ); + /* adjust contours count in newest outline */ + for ( n = 0; n < current->n_contours; n++ ) + current->contours[n] += base->n_points; - base->num_subglyphs += current->num_subglyphs; + base->n_points += current->n_points; + base->n_contours += current->n_contours; - /* adjust contours count in newest outline */ - for ( n = 0; n < n_curr_contours; n++ ) - current->outline.contours[n] = - (short)( current->outline.contours[n] + n_base_points ); + loader->base.num_subglyphs += loader->current.num_subglyphs; /* prepare for another new glyph image */ FT_GlyphLoader_Prepare( loader ); diff --git a/vendor/freetype/src/base/ftglyph.c b/vendor/freetype/src/base/ftglyph.c index 393d4949f8..1b5849f99a 100644 --- a/vendor/freetype/src/base/ftglyph.c +++ b/vendor/freetype/src/base/ftglyph.c @@ -4,7 +4,7 @@ * * FreeType convenience functions to handle glyphs (body). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/base/ftgxval.c b/vendor/freetype/src/base/ftgxval.c index 6b3c5d2484..6e38cb5ba9 100644 --- a/vendor/freetype/src/base/ftgxval.c +++ b/vendor/freetype/src/base/ftgxval.c @@ -4,7 +4,7 @@ * * FreeType API for validating TrueTypeGX/AAT tables (body). * - * Copyright (C) 2004-2023 by + * Copyright (C) 2004-2024 by * Masatake YAMATO, Redhat K.K, * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/vendor/freetype/src/base/ftinit.c b/vendor/freetype/src/base/ftinit.c index c9c71d24bf..9a6c00e13e 100644 --- a/vendor/freetype/src/base/ftinit.c +++ b/vendor/freetype/src/base/ftinit.c @@ -4,7 +4,7 @@ * * FreeType initialization layer (body). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/base/ftlcdfil.c b/vendor/freetype/src/base/ftlcdfil.c index 6c3fd66e0b..1e69d4da70 100644 --- a/vendor/freetype/src/base/ftlcdfil.c +++ b/vendor/freetype/src/base/ftlcdfil.c @@ -4,7 +4,7 @@ * * FreeType API for color filtering of subpixel bitmap glyphs (body). * - * Copyright (C) 2006-2023 by + * Copyright (C) 2006-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/base/ftmac.c b/vendor/freetype/src/base/ftmac.c index 492d055384..e8e35627b5 100644 --- a/vendor/freetype/src/base/ftmac.c +++ b/vendor/freetype/src/base/ftmac.c @@ -8,7 +8,7 @@ * This file is for Mac OS X only; see builds/mac/ftoldmac.c for * classic platforms built by MPW. * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -812,6 +812,7 @@ ResourceIndex res_index; Handle fond; short num_faces_in_res; + FT_Long count; if ( noErr != FT_FSPathMakeRes( pathname, &res_ref ) ) @@ -821,8 +822,10 @@ if ( ResError() ) return FT_THROW( Cannot_Open_Resource ); + res_index = 1; num_faces_in_res = 0; - for ( res_index = 1; ; res_index++ ) + count = face_index; + while ( count >= 0 ) { short num_faces_in_fond; @@ -834,15 +837,21 @@ num_faces_in_fond = count_faces( fond, pathname ); num_faces_in_res += num_faces_in_fond; - if ( 0 <= face_index && face_index < num_faces_in_fond && error ) - error = FT_New_Face_From_FOND( library, fond, face_index, aface ); + if ( count < num_faces_in_fond ) + error = FT_New_Face_From_FOND( library, fond, count, aface ); - face_index -= num_faces_in_fond; + res_index++; + count -= num_faces_in_fond; } CloseResFile( res_ref ); + if ( !error && aface && *aface ) - (*aface)->num_faces = num_faces_in_res; + { + (*aface)->num_faces = num_faces_in_res; + (*aface)->face_index = face_index; + } + return error; } diff --git a/vendor/freetype/src/base/ftmm.c b/vendor/freetype/src/base/ftmm.c index 9e2dd7ee79..cc4ca22fba 100644 --- a/vendor/freetype/src/base/ftmm.c +++ b/vendor/freetype/src/base/ftmm.c @@ -4,7 +4,7 @@ * * Multiple Master font support (body). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/base/ftobjs.c b/vendor/freetype/src/base/ftobjs.c index 89a25bc732..9b97820c37 100644 --- a/vendor/freetype/src/base/ftobjs.c +++ b/vendor/freetype/src/base/ftobjs.c @@ -4,7 +4,7 @@ * * The FreeType private base classes (body). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -2302,7 +2302,10 @@ face_index_internal, aface ); FT_FREE( data_offsets ); if ( !error ) - (*aface)->num_faces = count; + { + (*aface)->num_faces = count; + (*aface)->face_index = face_index_internal; + } } return error; @@ -5791,7 +5794,7 @@ ttface = (TT_Face)face; sfnt = (SFNT_Service)ttface->sfnt; - if ( sfnt->get_colr_layer ) + if ( sfnt->get_colr_glyph_paint ) return sfnt->get_colr_glyph_paint( ttface, base_glyph, root_transform, diff --git a/vendor/freetype/src/base/ftotval.c b/vendor/freetype/src/base/ftotval.c index 192e12a71f..aed9eef343 100644 --- a/vendor/freetype/src/base/ftotval.c +++ b/vendor/freetype/src/base/ftotval.c @@ -4,7 +4,7 @@ * * FreeType API for validating OpenType tables (body). * - * Copyright (C) 2004-2023 by + * Copyright (C) 2004-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/base/ftoutln.c b/vendor/freetype/src/base/ftoutln.c index 134f39d2b1..ef699b3c7c 100644 --- a/vendor/freetype/src/base/ftoutln.c +++ b/vendor/freetype/src/base/ftoutln.c @@ -4,7 +4,7 @@ * * FreeType outline management (body). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -53,7 +53,7 @@ FT_Vector* point; FT_Vector* limit; - char* tags; + FT_Byte* tags; FT_Error error; @@ -332,8 +332,8 @@ FT_NEW_ARRAY( anoutline->contours, numContours ) ) goto Fail; - anoutline->n_points = (FT_Short)numPoints; - anoutline->n_contours = (FT_Short)numContours; + anoutline->n_points = (FT_UShort)numPoints; + anoutline->n_contours = (FT_UShort)numContours; anoutline->flags |= FT_OUTLINE_OWNER; return FT_Err_Ok; @@ -359,12 +359,14 @@ FT_Int n; + FT_TRACE5(( "FT_Outline_Check: contours = %d, points = %d\n", + n_contours, n_points )); /* empty glyph? */ if ( n_points == 0 && n_contours == 0 ) return FT_Err_Ok; /* check point and contour counts */ - if ( n_points <= 0 || n_contours <= 0 ) + if ( n_points == 0 || n_contours == 0 ) goto Bad; end0 = -1; @@ -576,13 +578,13 @@ /* reverse tags table */ { - char* p = outline->tags + first; - char* q = outline->tags + last; + FT_Byte* p = outline->tags + first; + FT_Byte* q = outline->tags + last; while ( p < q ) { - char swap; + FT_Byte swap; swap = *p; diff --git a/vendor/freetype/src/base/ftpatent.c b/vendor/freetype/src/base/ftpatent.c index cb5efadffb..2055757e02 100644 --- a/vendor/freetype/src/base/ftpatent.c +++ b/vendor/freetype/src/base/ftpatent.c @@ -5,7 +5,7 @@ * FreeType API for checking patented TrueType bytecode instructions * (body). Obsolete, retained for backward compatibility. * - * Copyright (C) 2007-2023 by + * Copyright (C) 2007-2024 by * David Turner. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/base/ftpfr.c b/vendor/freetype/src/base/ftpfr.c index 378385a591..0caa9d1d58 100644 --- a/vendor/freetype/src/base/ftpfr.c +++ b/vendor/freetype/src/base/ftpfr.c @@ -4,7 +4,7 @@ * * FreeType API for accessing PFR-specific data (body). * - * Copyright (C) 2002-2023 by + * Copyright (C) 2002-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/base/ftpsprop.c b/vendor/freetype/src/base/ftpsprop.c index cefdf489d7..37a6cee6cc 100644 --- a/vendor/freetype/src/base/ftpsprop.c +++ b/vendor/freetype/src/base/ftpsprop.c @@ -5,7 +5,7 @@ * Get and set properties of PostScript drivers (body). * See `ftdriver.h' for available properties. * - * Copyright (C) 2017-2023 by + * Copyright (C) 2017-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/base/ftrfork.c b/vendor/freetype/src/base/ftrfork.c index 2ab430195f..dc9b043d8b 100644 --- a/vendor/freetype/src/base/ftrfork.c +++ b/vendor/freetype/src/base/ftrfork.c @@ -4,7 +4,7 @@ * * Embedded resource forks accessor (body). * - * Copyright (C) 2004-2023 by + * Copyright (C) 2004-2024 by * Masatake YAMATO and Redhat K.K. * * FT_Raccess_Get_HeaderInfo() and raccess_guess_darwin_hfsplus() are diff --git a/vendor/freetype/src/base/ftsnames.c b/vendor/freetype/src/base/ftsnames.c index 1917a3f1df..f7231fd61c 100644 --- a/vendor/freetype/src/base/ftsnames.c +++ b/vendor/freetype/src/base/ftsnames.c @@ -7,7 +7,7 @@ * * This is _not_ used to retrieve glyph names! * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/base/ftstream.c b/vendor/freetype/src/base/ftstream.c index 64826acebe..41fd913be9 100644 --- a/vendor/freetype/src/base/ftstream.c +++ b/vendor/freetype/src/base/ftstream.c @@ -4,7 +4,7 @@ * * I/O stream support (body). * - * Copyright (C) 2000-2023 by + * Copyright (C) 2000-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -830,7 +830,7 @@ goto Exit; } - /* now, compute the signed value is necessary */ + /* now, compute the signed value if necessary */ if ( fields->value & FT_FRAME_OP_SIGNED ) value = (FT_ULong)( (FT_Int32)( value << sign_shift ) >> sign_shift ); diff --git a/vendor/freetype/src/base/ftstroke.c b/vendor/freetype/src/base/ftstroke.c index 92f1e43080..64f46ce43e 100644 --- a/vendor/freetype/src/base/ftstroke.c +++ b/vendor/freetype/src/base/ftstroke.c @@ -4,7 +4,7 @@ * * FreeType path stroker (body). * - * Copyright (C) 2002-2023 by + * Copyright (C) 2002-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -711,7 +711,7 @@ { FT_UInt count = border->num_points; FT_Byte* read = border->tags; - FT_Byte* write = (FT_Byte*)outline->tags + outline->n_points; + FT_Byte* write = outline->tags + outline->n_points; for ( ; count > 0; count--, read++, write++ ) @@ -727,10 +727,10 @@ /* copy contours */ { - FT_UInt count = border->num_points; - FT_Byte* tags = border->tags; - FT_Short* write = outline->contours + outline->n_contours; - FT_Short idx = (FT_Short)outline->n_points; + FT_UInt count = border->num_points; + FT_Byte* tags = border->tags; + FT_UShort* write = outline->contours + outline->n_contours; + FT_UShort idx = outline->n_points; for ( ; count > 0; count--, tags++, idx++ ) @@ -743,7 +743,7 @@ } } - outline->n_points += (short)border->num_points; + outline->n_points += (FT_UShort)border->num_points; FT_ASSERT( FT_Outline_Check( outline ) == 0 ); } @@ -2050,7 +2050,7 @@ FT_Vector* point; FT_Vector* limit; - char* tags; + FT_Byte* tags; FT_Error error; diff --git a/vendor/freetype/src/base/ftsynth.c b/vendor/freetype/src/base/ftsynth.c index f32edd3388..ec05bce33a 100644 --- a/vendor/freetype/src/base/ftsynth.c +++ b/vendor/freetype/src/base/ftsynth.c @@ -4,7 +4,7 @@ * * FreeType synthesizing code for emboldening and slanting (body). * - * Copyright (C) 2000-2023 by + * Copyright (C) 2000-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/base/ftsystem.c b/vendor/freetype/src/base/ftsystem.c index 61c99e3635..eee3642334 100644 --- a/vendor/freetype/src/base/ftsystem.c +++ b/vendor/freetype/src/base/ftsystem.c @@ -4,7 +4,7 @@ * * ANSI-specific FreeType low-level system interface (body). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/base/fttrigon.c b/vendor/freetype/src/base/fttrigon.c index 2dd2c3459e..4b1aced1cb 100644 --- a/vendor/freetype/src/base/fttrigon.c +++ b/vendor/freetype/src/base/fttrigon.c @@ -4,7 +4,7 @@ * * FreeType trigonometric functions (body). * - * Copyright (C) 2001-2023 by + * Copyright (C) 2001-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/base/fttype1.c b/vendor/freetype/src/base/fttype1.c index 637c5cf775..cedf7c4050 100644 --- a/vendor/freetype/src/base/fttype1.c +++ b/vendor/freetype/src/base/fttype1.c @@ -4,7 +4,7 @@ * * FreeType utility file for PS names support (body). * - * Copyright (C) 2002-2023 by + * Copyright (C) 2002-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/base/ftutil.c b/vendor/freetype/src/base/ftutil.c index 6120846d2c..b13512f870 100644 --- a/vendor/freetype/src/base/ftutil.c +++ b/vendor/freetype/src/base/ftutil.c @@ -4,7 +4,7 @@ * * FreeType utility file for memory and list management (body). * - * Copyright (C) 2002-2023 by + * Copyright (C) 2002-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/base/ftver.rc b/vendor/freetype/src/base/ftver.rc index 137a6334b7..62490c0638 100644 --- a/vendor/freetype/src/base/ftver.rc +++ b/vendor/freetype/src/base/ftver.rc @@ -4,7 +4,7 @@ /* */ /* FreeType VERSIONINFO resource for Windows DLLs. */ /* */ -/* Copyright (C) 2018-2023 by */ +/* Copyright (C) 2018-2024 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ diff --git a/vendor/freetype/src/base/ftwinfnt.c b/vendor/freetype/src/base/ftwinfnt.c index 03b023e079..e849a15f42 100644 --- a/vendor/freetype/src/base/ftwinfnt.c +++ b/vendor/freetype/src/base/ftwinfnt.c @@ -4,7 +4,7 @@ * * FreeType API for accessing Windows FNT specific info (body). * - * Copyright (C) 2003-2023 by + * Copyright (C) 2003-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/bdf/bdflib.c b/vendor/freetype/src/bdf/bdflib.c index 0fa7e0a8c5..813a4d839c 100644 --- a/vendor/freetype/src/bdf/bdflib.c +++ b/vendor/freetype/src/bdf/bdflib.c @@ -864,15 +864,9 @@ p = font->user_props + font->nuser_props; - n = ft_strlen( name ) + 1; - if ( n > FT_LONG_MAX ) - return FT_THROW( Invalid_Argument ); - - if ( FT_QALLOC( p->name, n ) ) + if ( FT_STRDUP( p->name, name ) ) goto Exit; - FT_MEM_COPY( (char *)p->name, name, n ); - p->format = format; p->builtin = 0; p->value.atom = NULL; /* nothing is ever stored here */ @@ -1442,11 +1436,9 @@ goto Exit; } - if ( FT_QALLOC( p->glyph_name, slen + 1 ) ) + if ( FT_DUP( p->glyph_name, s, slen + 1 ) ) goto Exit; - FT_MEM_COPY( p->glyph_name, s, slen + 1 ); - p->flags |= BDF_GLYPH_; FT_TRACE4(( DBGMSG1, lineno, s )); @@ -2051,9 +2043,8 @@ /* Allowing multiple `FONT' lines (which is invalid) doesn't hurt... */ FT_FREE( p->font->name ); - if ( FT_QALLOC( p->font->name, slen + 1 ) ) + if ( FT_DUP( p->font->name, s, slen + 1 ) ) goto Exit; - FT_MEM_COPY( p->font->name, s, slen + 1 ); /* If the font name is an XLFD name, set the spacing to the one in */ /* the font name. If there is no spacing fall back on the default. */ diff --git a/vendor/freetype/src/bzip2/ftbzip2.c b/vendor/freetype/src/bzip2/ftbzip2.c index ad342bd011..a0249eb8d4 100644 --- a/vendor/freetype/src/bzip2/ftbzip2.c +++ b/vendor/freetype/src/bzip2/ftbzip2.c @@ -8,7 +8,7 @@ * parse compressed PCF fonts, as found with many X11 server * distributions. * - * Copyright (C) 2010-2023 by + * Copyright (C) 2010-2024 by * Joel Klinghed. * * based on `src/gzip/ftgzip.c' diff --git a/vendor/freetype/src/cache/ftcache.c b/vendor/freetype/src/cache/ftcache.c index 1af2e67727..81e0347af9 100644 --- a/vendor/freetype/src/cache/ftcache.c +++ b/vendor/freetype/src/cache/ftcache.c @@ -4,7 +4,7 @@ * * The FreeType Caching sub-system (body only). * - * Copyright (C) 2000-2023 by + * Copyright (C) 2000-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/cache/ftcbasic.c b/vendor/freetype/src/cache/ftcbasic.c index 24a56c8d26..04f664fad7 100644 --- a/vendor/freetype/src/cache/ftcbasic.c +++ b/vendor/freetype/src/cache/ftcbasic.c @@ -4,7 +4,7 @@ * * The FreeType basic cache interface (body). * - * Copyright (C) 2003-2023 by + * Copyright (C) 2003-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -37,7 +37,7 @@ typedef struct FTC_BasicAttrRec_ { FTC_ScalerRec scaler; - FT_UInt load_flags; + FT_Int32 load_flags; } FTC_BasicAttrRec, *FTC_BasicAttrs; @@ -143,10 +143,9 @@ FT_Face face = size->face; - error = FT_Load_Glyph( - face, - gindex, - (FT_Int)family->attrs.load_flags | FT_LOAD_RENDER ); + error = FT_Load_Glyph( face, + gindex, + family->attrs.load_flags | FT_LOAD_RENDER ); if ( !error ) *aface = face; } @@ -176,9 +175,7 @@ { face = size->face; - error = FT_Load_Glyph( face, - gindex, - (FT_Int)family->attrs.load_flags ); + error = FT_Load_Glyph( face, gindex, family->attrs.load_flags ); if ( !error ) { if ( face->glyph->format == FT_GLYPH_FORMAT_BITMAP || @@ -246,7 +243,6 @@ ftc_basic_family_compare, /* FTC_MruNode_CompareFunc node_compare */ ftc_basic_family_init, /* FTC_MruNode_InitFunc node_init */ - NULL, /* FTC_MruNode_ResetFunc node_reset */ NULL /* FTC_MruNode_DoneFunc node_done */ }, @@ -293,40 +289,24 @@ FT_Glyph *aglyph, FTC_Node *anode ) { - FTC_BasicQueryRec query; - FTC_Node node = 0; /* make compiler happy */ FT_Error error; + FTC_BasicQueryRec query; + FTC_Node node = NULL; /* make compiler happy */ FT_Offset hash; - /* some argument checks are delayed to `FTC_Cache_Lookup' */ + /* other argument checks delayed to `FTC_Cache_Lookup' */ if ( !aglyph ) - { - error = FT_THROW( Invalid_Argument ); - goto Exit; - } + return FT_THROW( Invalid_Argument ); *aglyph = NULL; if ( anode ) - *anode = NULL; - - /* - * Internal `FTC_BasicAttr->load_flags' is of type `FT_UInt', - * but public `FT_ImageType->flags' is of type `FT_Int32'. - * - * On 16bit systems, higher bits of type->flags cannot be handled. - */ -#if 0xFFFFFFFFUL > FT_UINT_MAX - if ( (type->flags & (FT_ULong)FT_UINT_MAX) ) - FT_TRACE1(( "FTC_ImageCache_Lookup:" - " higher bits in load_flags 0x%lx are dropped\n", - (FT_ULong)type->flags & ~((FT_ULong)FT_UINT_MAX) )); -#endif + *anode = NULL; query.attrs.scaler.face_id = type->face_id; query.attrs.scaler.width = type->width; query.attrs.scaler.height = type->height; - query.attrs.load_flags = (FT_UInt)type->flags; + query.attrs.load_flags = type->flags; query.attrs.scaler.pixel = 1; query.attrs.scaler.x_res = 0; /* make compilers happy */ @@ -334,7 +314,7 @@ hash = FTC_BASIC_ATTR_HASH( &query.attrs ) + gindex; -#if 1 /* inlining is about 50% faster! */ +#ifdef FTC_INLINE /* inlining is about 50% faster! */ FTC_GCACHE_LOOKUP_CMP( cache, ftc_basic_family_compare, ftc_gnode_compare, @@ -359,7 +339,6 @@ } } - Exit: return error; } @@ -374,38 +353,35 @@ FT_Glyph *aglyph, FTC_Node *anode ) { - FTC_BasicQueryRec query; - FTC_Node node = 0; /* make compiler happy */ FT_Error error; + FTC_BasicQueryRec query; + FTC_Node node = NULL; /* make compiler happy */ FT_Offset hash; - /* some argument checks are delayed to `FTC_Cache_Lookup' */ + /* other argument checks delayed to `FTC_Cache_Lookup' */ if ( !aglyph || !scaler ) - { - error = FT_THROW( Invalid_Argument ); - goto Exit; - } + return FT_THROW( Invalid_Argument ); *aglyph = NULL; if ( anode ) - *anode = NULL; + *anode = NULL; /* - * Internal `FTC_BasicAttr->load_flags' is of type `FT_UInt', + * Internal `FTC_BasicAttr->load_flags' is of type `FT_Int32', * but public `FT_Face->face_flags' is of type `FT_Long'. * * On long > int systems, higher bits of load_flags cannot be handled. */ -#if FT_ULONG_MAX > FT_UINT_MAX - if ( load_flags > FT_UINT_MAX ) +#if FT_ULONG_MAX > 0xFFFFFFFFUL + if ( load_flags > 0xFFFFFFFFUL ) FT_TRACE1(( "FTC_ImageCache_LookupScaler:" " higher bits in load_flags 0x%lx are dropped\n", - load_flags & ~((FT_ULong)FT_UINT_MAX) )); + load_flags & ~0xFFFFFFFFUL )); #endif query.attrs.scaler = scaler[0]; - query.attrs.load_flags = (FT_UInt)load_flags; + query.attrs.load_flags = (FT_Int32)load_flags; hash = FTC_BASIC_ATTR_HASH( &query.attrs ) + gindex; @@ -427,7 +403,6 @@ } } - Exit: return error; } @@ -445,7 +420,6 @@ sizeof ( FTC_BasicFamilyRec ), ftc_basic_family_compare, /* FTC_MruNode_CompareFunc node_compare */ ftc_basic_family_init, /* FTC_MruNode_InitFunc node_init */ - NULL, /* FTC_MruNode_ResetFunc node_reset */ NULL /* FTC_MruNode_DoneFunc node_done */ }, @@ -495,36 +469,22 @@ { FT_Error error; FTC_BasicQueryRec query; - FTC_Node node = 0; /* make compiler happy */ + FTC_Node node = NULL; /* make compiler happy */ FT_Offset hash; - if ( anode ) - *anode = NULL; - /* other argument checks delayed to `FTC_Cache_Lookup' */ if ( !ansbit ) return FT_THROW( Invalid_Argument ); *ansbit = NULL; - - /* - * Internal `FTC_BasicAttr->load_flags' is of type `FT_UInt', - * but public `FT_ImageType->flags' is of type `FT_Int32'. - * - * On 16bit systems, higher bits of type->flags cannot be handled. - */ -#if 0xFFFFFFFFUL > FT_UINT_MAX - if ( (type->flags & (FT_ULong)FT_UINT_MAX) ) - FT_TRACE1(( "FTC_ImageCache_Lookup:" - " higher bits in load_flags 0x%lx are dropped\n", - (FT_ULong)type->flags & ~((FT_ULong)FT_UINT_MAX) )); -#endif + if ( anode ) + *anode = NULL; query.attrs.scaler.face_id = type->face_id; query.attrs.scaler.width = type->width; query.attrs.scaler.height = type->height; - query.attrs.load_flags = (FT_UInt)type->flags; + query.attrs.load_flags = type->flags; query.attrs.scaler.pixel = 1; query.attrs.scaler.x_res = 0; /* make compilers happy */ @@ -534,7 +494,7 @@ hash = FTC_BASIC_ATTR_HASH( &query.attrs ) + gindex / FTC_SBIT_ITEMS_PER_NODE; -#if 1 /* inlining is about 50% faster! */ +#ifdef FTC_INLINE /* inlining is about 50% faster! */ FTC_GCACHE_LOOKUP_CMP( cache, ftc_basic_family_compare, ftc_snode_compare, @@ -578,34 +538,33 @@ { FT_Error error; FTC_BasicQueryRec query; - FTC_Node node = 0; /* make compiler happy */ + FTC_Node node = NULL; /* make compiler happy */ FT_Offset hash; - if ( anode ) - *anode = NULL; - /* other argument checks delayed to `FTC_Cache_Lookup' */ if ( !ansbit || !scaler ) - return FT_THROW( Invalid_Argument ); + return FT_THROW( Invalid_Argument ); *ansbit = NULL; + if ( anode ) + *anode = NULL; /* - * Internal `FTC_BasicAttr->load_flags' is of type `FT_UInt', + * Internal `FTC_BasicAttr->load_flags' is of type `FT_Int32', * but public `FT_Face->face_flags' is of type `FT_Long'. * * On long > int systems, higher bits of load_flags cannot be handled. */ -#if FT_ULONG_MAX > FT_UINT_MAX - if ( load_flags > FT_UINT_MAX ) +#if FT_ULONG_MAX > 0xFFFFFFFFUL + if ( load_flags > 0xFFFFFFFFUL ) FT_TRACE1(( "FTC_ImageCache_LookupScaler:" " higher bits in load_flags 0x%lx are dropped\n", - load_flags & ~((FT_ULong)FT_UINT_MAX) )); + load_flags & ~0xFFFFFFFFUL )); #endif query.attrs.scaler = scaler[0]; - query.attrs.load_flags = (FT_UInt)load_flags; + query.attrs.load_flags = (FT_Int32)load_flags; /* beware, the hash must be the same for all glyph ranges! */ hash = FTC_BASIC_ATTR_HASH( &query.attrs ) + diff --git a/vendor/freetype/src/cache/ftccache.c b/vendor/freetype/src/cache/ftccache.c index e0698557b7..8a3d887f96 100644 --- a/vendor/freetype/src/cache/ftccache.c +++ b/vendor/freetype/src/cache/ftccache.c @@ -4,7 +4,7 @@ * * The FreeType internal cache interface (body). * - * Copyright (C) 2000-2023 by + * Copyright (C) 2000-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -544,7 +544,6 @@ FTC_FaceID face_id ) { FTC_Manager manager = cache->manager; - FTC_Node frees = NULL; FT_UFast count = cache->p; FT_UFast i; @@ -557,41 +556,27 @@ for (;;) { FTC_Node node = *pnode; - FT_Bool list_changed = FALSE; if ( !node ) break; - if ( cache->clazz.node_remove_faceid( node, face_id, - cache, &list_changed ) ) + if ( cache->clazz.node_remove_faceid( node, face_id, cache, NULL ) ) { - *pnode = node->link; - node->link = frees; - frees = node; + *pnode = node->link; + + manager->cur_weight -= cache->clazz.node_weight( node, cache ); + ftc_node_mru_unlink( node, manager ); + + cache->clazz.node_free( node, cache ); + + cache->slack++; } else pnode = &node->link; } } - /* remove all nodes in the free list */ - while ( frees ) - { - FTC_Node node; - - - node = frees; - frees = node->link; - - manager->cur_weight -= cache->clazz.node_weight( node, cache ); - ftc_node_mru_unlink( node, manager ); - - cache->clazz.node_free( node, cache ); - - cache->slack++; - } - ftc_cache_resize( cache ); } diff --git a/vendor/freetype/src/cache/ftccache.h b/vendor/freetype/src/cache/ftccache.h index 850d2554b5..85d321c12c 100644 --- a/vendor/freetype/src/cache/ftccache.h +++ b/vendor/freetype/src/cache/ftccache.h @@ -4,7 +4,7 @@ * * FreeType internal cache interface (specification). * - * Copyright (C) 2000-2023 by + * Copyright (C) 2000-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -87,6 +87,10 @@ FT_BEGIN_HEADER ftc_get_top_node_for_hash( ( cache ), ( hash ) ) #endif + FT_LOCAL( void ) + ftc_node_destroy( FTC_Node node, + FTC_Manager manager ); + /*************************************************************************/ /*************************************************************************/ diff --git a/vendor/freetype/src/cache/ftccback.h b/vendor/freetype/src/cache/ftccback.h index 5f9db213a8..a1d76baa74 100644 --- a/vendor/freetype/src/cache/ftccback.h +++ b/vendor/freetype/src/cache/ftccback.h @@ -4,7 +4,7 @@ * * Callback functions of the caching sub-system (specification only). * - * Copyright (C) 2004-2023 by + * Copyright (C) 2004-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -19,11 +19,7 @@ #define FTCCBACK_H_ #include -#include "ftcmru.h" -#include "ftcimage.h" -#include "ftcmanag.h" -#include "ftcglyph.h" -#include "ftcsbits.h" +#include "ftccache.h" FT_BEGIN_HEADER @@ -81,10 +77,6 @@ FT_BEGIN_HEADER FT_LOCAL( void ) ftc_cache_done( FTC_Cache cache ); - FT_LOCAL( void ) - ftc_node_destroy( FTC_Node node, - FTC_Manager manager ); - FT_END_HEADER #endif /* FTCCBACK_H_ */ diff --git a/vendor/freetype/src/cache/ftccmap.c b/vendor/freetype/src/cache/ftccmap.c index 84f22a6675..b5c61e8160 100644 --- a/vendor/freetype/src/cache/ftccmap.c +++ b/vendor/freetype/src/cache/ftccmap.c @@ -4,7 +4,7 @@ * * FreeType CharMap cache (body) * - * Copyright (C) 2000-2023 by + * Copyright (C) 2000-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -264,7 +264,7 @@ hash = FTC_CMAP_HASH( face_id, (FT_UInt)cmap_index, char_code ); -#if 1 +#ifdef FTC_INLINE FTC_CACHE_LOOKUP_CMP( cache, ftc_cmap_node_compare, hash, &query, node, error ); #else diff --git a/vendor/freetype/src/cache/ftcerror.h b/vendor/freetype/src/cache/ftcerror.h index dc1a62013d..daabcc6121 100644 --- a/vendor/freetype/src/cache/ftcerror.h +++ b/vendor/freetype/src/cache/ftcerror.h @@ -4,7 +4,7 @@ * * Caching sub-system error codes (specification only). * - * Copyright (C) 2001-2023 by + * Copyright (C) 2001-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/cache/ftcglyph.c b/vendor/freetype/src/cache/ftcglyph.c index d344733f37..5e7856378a 100644 --- a/vendor/freetype/src/cache/ftcglyph.c +++ b/vendor/freetype/src/cache/ftcglyph.c @@ -4,7 +4,7 @@ * * FreeType Glyph Image (FT_Glyph) cache (body). * - * Copyright (C) 2000-2023 by + * Copyright (C) 2000-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -180,7 +180,7 @@ query->gindex = gindex; - FTC_MRULIST_LOOKUP( &cache->families, query, query->family, error ); + FTC_MRULIST_LOOKUP( &gcache->families, query, query->family, error ); if ( !error ) { FTC_Family family = query->family; @@ -193,7 +193,7 @@ error = FTC_Cache_Lookup( FTC_CACHE( gcache ), hash, query, anode ); if ( --family->num_nodes == 0 ) - FTC_FAMILY_FREE( family, cache ); + FTC_FAMILY_FREE( family, FTC_CACHE( gcache ) ); } return error; } diff --git a/vendor/freetype/src/cache/ftcglyph.h b/vendor/freetype/src/cache/ftcglyph.h index 0181e98166..b1a96da8ec 100644 --- a/vendor/freetype/src/cache/ftcglyph.h +++ b/vendor/freetype/src/cache/ftcglyph.h @@ -4,7 +4,7 @@ * * FreeType abstract glyph cache (specification). * - * Copyright (C) 2000-2023 by + * Copyright (C) 2000-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -65,7 +65,6 @@ * - FTC_Family sub-class, e.g. MyFamily, with relevant methods: * my_family_compare * my_family_init - * my_family_reset (optional) * my_family_done * * - FTC_GQuery sub-class, e.g. MyQuery, to hold cache-specific query diff --git a/vendor/freetype/src/cache/ftcimage.c b/vendor/freetype/src/cache/ftcimage.c index 428e5e1a71..1463064050 100644 --- a/vendor/freetype/src/cache/ftcimage.c +++ b/vendor/freetype/src/cache/ftcimage.c @@ -4,7 +4,7 @@ * * FreeType Image cache (body). * - * Copyright (C) 2000-2023 by + * Copyright (C) 2000-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -34,11 +34,7 @@ FT_Memory memory = cache->memory; - if ( inode->glyph ) - { - FT_Done_Glyph( inode->glyph ); - inode->glyph = NULL; - } + FT_Done_Glyph( inode->glyph ); FTC_GNode_Done( FTC_GNODE( inode ), cache ); FT_FREE( inode ); @@ -119,10 +115,9 @@ { case FT_GLYPH_FORMAT_BITMAP: { - FT_BitmapGlyph bitg; + FT_BitmapGlyph bitg = (FT_BitmapGlyph)glyph; - bitg = (FT_BitmapGlyph)glyph; size = bitg->bitmap.rows * (FT_Offset)FT_ABS( bitg->bitmap.pitch ) + sizeof ( *bitg ); } @@ -130,10 +125,9 @@ case FT_GLYPH_FORMAT_OUTLINE: { - FT_OutlineGlyph outg; + FT_OutlineGlyph outg = (FT_OutlineGlyph)glyph; - outg = (FT_OutlineGlyph)glyph; size = (FT_Offset)outg->outline.n_points * ( sizeof ( FT_Vector ) + sizeof ( FT_Byte ) ) + (FT_Offset)outg->outline.n_contours * sizeof ( FT_Short ) + diff --git a/vendor/freetype/src/cache/ftcimage.h b/vendor/freetype/src/cache/ftcimage.h index d2a807f158..a0c4a97259 100644 --- a/vendor/freetype/src/cache/ftcimage.h +++ b/vendor/freetype/src/cache/ftcimage.h @@ -4,7 +4,7 @@ * * FreeType Generic Image cache (specification) * - * Copyright (C) 2000-2023 by + * Copyright (C) 2000-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/cache/ftcmanag.c b/vendor/freetype/src/cache/ftcmanag.c index 94f8469c92..c0a48a53b7 100644 --- a/vendor/freetype/src/cache/ftcmanag.c +++ b/vendor/freetype/src/cache/ftcmanag.c @@ -4,7 +4,7 @@ * * FreeType Cache Manager (body). * - * Copyright (C) 2000-2023 by + * Copyright (C) 2000-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -22,7 +22,6 @@ #include #include -#include "ftccback.h" #include "ftcerror.h" @@ -86,12 +85,10 @@ FT_Pointer data ) { FTC_SizeNode node = (FTC_SizeNode)ftcnode; - FT_Size size = node->size; FT_UNUSED( data ); - if ( size ) - FT_Done_Size( size ); + FT_Done_Size( node->size ); } @@ -118,32 +115,21 @@ FT_Pointer ftcscaler, FT_Pointer ftcmanager ) { + FT_Error error; + FT_Size size; FTC_SizeNode node = (FTC_SizeNode)ftcnode; FTC_Scaler scaler = (FTC_Scaler)ftcscaler; FTC_Manager manager = (FTC_Manager)ftcmanager; - node->scaler = scaler[0]; - - return ftc_scaler_lookup_size( manager, scaler, &node->size ); - } - - - FT_CALLBACK_DEF( FT_Error ) - ftc_size_node_reset( FTC_MruNode ftcnode, - FT_Pointer ftcscaler, - FT_Pointer ftcmanager ) - { - FTC_SizeNode node = (FTC_SizeNode)ftcnode; - FTC_Scaler scaler = (FTC_Scaler)ftcscaler; - FTC_Manager manager = (FTC_Manager)ftcmanager; - - - FT_Done_Size( node->size ); - - node->scaler = scaler[0]; + error = ftc_scaler_lookup_size( manager, scaler, &size ); + if ( !error ) + { + node->size = size; + node->scaler = scaler[0]; + } - return ftc_scaler_lookup_size( manager, scaler, &node->size ); + return error; } @@ -154,7 +140,6 @@ ftc_size_node_compare, /* FTC_MruNode_CompareFunc node_compare */ ftc_size_node_init, /* FTC_MruNode_InitFunc node_init */ - ftc_size_node_reset, /* FTC_MruNode_ResetFunc node_reset */ ftc_size_node_done /* FTC_MruNode_DoneFunc node_done */ }; @@ -231,23 +216,25 @@ FT_Pointer ftcface_id, FT_Pointer ftcmanager ) { + FT_Error error; + FT_Face face; FTC_FaceNode node = (FTC_FaceNode)ftcnode; FTC_FaceID face_id = (FTC_FaceID)ftcface_id; FTC_Manager manager = (FTC_Manager)ftcmanager; - FT_Error error; - - node->face_id = face_id; error = manager->request_face( face_id, manager->library, manager->request_data, - &node->face ); + &face ); if ( !error ) { /* destroy initial size object; it will be re-created later */ - if ( node->face->size ) - FT_Done_Size( node->face->size ); + if ( face->size ) + FT_Done_Size( face->size ); + + node->face = face; + node->face_id = face_id; } return error; @@ -294,7 +281,6 @@ ftc_face_node_compare, /* FTC_MruNode_CompareFunc node_compare */ ftc_face_node_init, /* FTC_MruNode_InitFunc node_init */ - NULL, /* FTC_MruNode_ResetFunc node_reset */ ftc_face_node_done /* FTC_MruNode_DoneFunc node_done */ }; @@ -435,18 +421,13 @@ { cache->clazz.cache_done( cache ); FT_FREE( cache ); - manager->caches[idx] = NULL; } } - manager->num_caches = 0; /* discard faces and sizes */ FTC_MruList_Done( &manager->sizes ); FTC_MruList_Done( &manager->faces ); - manager->library = NULL; - manager->memory = NULL; - FT_FREE( manager ); } diff --git a/vendor/freetype/src/cache/ftcmanag.h b/vendor/freetype/src/cache/ftcmanag.h index 5b30929c9a..bd158f5ffb 100644 --- a/vendor/freetype/src/cache/ftcmanag.h +++ b/vendor/freetype/src/cache/ftcmanag.h @@ -4,7 +4,7 @@ * * FreeType Cache Manager (specification). * - * Copyright (C) 2000-2023 by + * Copyright (C) 2000-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/cache/ftcmru.c b/vendor/freetype/src/cache/ftcmru.c index ad10a06bc4..f908eb25a6 100644 --- a/vendor/freetype/src/cache/ftcmru.c +++ b/vendor/freetype/src/cache/ftcmru.c @@ -4,7 +4,7 @@ * * FreeType MRU support (body). * - * Copyright (C) 2003-2023 by + * Copyright (C) 2003-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -238,52 +238,43 @@ { FT_Error error; FTC_MruNode node = NULL; + FTC_MruNode prev = NULL; FT_Memory memory = list->memory; - if ( list->num_nodes >= list->max_nodes && list->max_nodes > 0 ) - { - node = list->nodes->prev; - - FT_ASSERT( node ); - - if ( list->clazz.node_reset ) - { - FTC_MruNode_Up( &list->nodes, node ); - - error = list->clazz.node_reset( node, key, list->data ); - if ( !error ) - goto Exit; - } - - FTC_MruNode_Remove( &list->nodes, node ); - list->num_nodes--; - - if ( list->clazz.node_done ) - list->clazz.node_done( node, list->data ); - } - /* zero new node in case of node_init failure */ - else if ( FT_ALLOC( node, list->clazz.node_size ) ) + if ( FT_ALLOC( node, list->clazz.node_size ) ) goto Exit; error = list->clazz.node_init( node, key, list->data ); if ( error ) - goto Fail; + { + prev = node; + node = NULL; + + goto Clean; + } + else if ( list->max_nodes > 0 && list->num_nodes >= list->max_nodes ) + prev = list->nodes->prev; FTC_MruNode_Prepend( &list->nodes, node ); list->num_nodes++; - Exit: - *anode = node; - return error; + if ( !prev ) + goto Exit; - Fail: + FTC_MruNode_Remove( &list->nodes, prev ); + list->num_nodes--; + + Clean: if ( list->clazz.node_done ) - list->clazz.node_done( node, list->data ); + list->clazz.node_done( prev, list->data ); - FT_FREE( node ); - goto Exit; + FT_FREE( prev ); + + Exit: + *anode = node; + return error; } @@ -309,18 +300,16 @@ FTC_MruList_Remove( FTC_MruList list, FTC_MruNode node ) { - FTC_MruNode_Remove( &list->nodes, node ); - list->num_nodes--; + FT_Memory memory = list->memory; - { - FT_Memory memory = list->memory; + FTC_MruNode_Remove( &list->nodes, node ); + list->num_nodes--; - if ( list->clazz.node_done ) - list->clazz.node_done( node, list->data ); + if ( list->clazz.node_done ) + list->clazz.node_done( node, list->data ); - FT_FREE( node ); - } + FT_FREE( node ); } diff --git a/vendor/freetype/src/cache/ftcmru.h b/vendor/freetype/src/cache/ftcmru.h index 45e5249ca4..68faab9847 100644 --- a/vendor/freetype/src/cache/ftcmru.h +++ b/vendor/freetype/src/cache/ftcmru.h @@ -4,7 +4,7 @@ * * Simple MRU list-cache (specification). * - * Copyright (C) 2000-2023 by + * Copyright (C) 2000-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -95,11 +95,6 @@ FT_BEGIN_HEADER FT_Pointer key, FT_Pointer data ); - typedef FT_Error - (*FTC_MruNode_ResetFunc)( FTC_MruNode node, - FT_Pointer key, - FT_Pointer data ); - typedef void (*FTC_MruNode_DoneFunc)( FTC_MruNode node, FT_Pointer data ); @@ -111,7 +106,6 @@ FT_BEGIN_HEADER FTC_MruNode_CompareFunc node_compare; FTC_MruNode_InitFunc node_init; - FTC_MruNode_ResetFunc node_reset; FTC_MruNode_DoneFunc node_done; } FTC_MruListClassRec; diff --git a/vendor/freetype/src/cache/ftcsbits.c b/vendor/freetype/src/cache/ftcsbits.c index 9929a0bcc3..19f3ef04d6 100644 --- a/vendor/freetype/src/cache/ftcsbits.c +++ b/vendor/freetype/src/cache/ftcsbits.c @@ -4,7 +4,7 @@ * * FreeType sbits manager (body). * - * Copyright (C) 2000-2023 by + * Copyright (C) 2000-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -53,8 +53,7 @@ size = (FT_ULong)pitch * bitmap->rows; - if ( !FT_QALLOC( sbit->buffer, size ) ) - FT_MEM_COPY( sbit->buffer, bitmap->buffer, size ); + FT_MEM_DUP( sbit->buffer, bitmap->buffer, size ); return error; } diff --git a/vendor/freetype/src/cache/ftcsbits.h b/vendor/freetype/src/cache/ftcsbits.h index e833cb5c30..d7c4a36475 100644 --- a/vendor/freetype/src/cache/ftcsbits.h +++ b/vendor/freetype/src/cache/ftcsbits.h @@ -4,7 +4,7 @@ * * A small-bitmap cache (specification). * - * Copyright (C) 2000-2023 by + * Copyright (C) 2000-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/cff/cff.c b/vendor/freetype/src/cff/cff.c index b486c389e1..e3e009699d 100644 --- a/vendor/freetype/src/cff/cff.c +++ b/vendor/freetype/src/cff/cff.c @@ -4,7 +4,7 @@ * * FreeType OpenType driver component (body only). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/cff/cffcmap.c b/vendor/freetype/src/cff/cffcmap.c index 10d287bc81..ea5f8ed288 100644 --- a/vendor/freetype/src/cff/cffcmap.c +++ b/vendor/freetype/src/cff/cffcmap.c @@ -4,7 +4,7 @@ * * CFF character mapping table (cmap) support (body). * - * Copyright (C) 2002-2023 by + * Copyright (C) 2002-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/cff/cffcmap.h b/vendor/freetype/src/cff/cffcmap.h index b2afc2fab6..1dd8700cd8 100644 --- a/vendor/freetype/src/cff/cffcmap.h +++ b/vendor/freetype/src/cff/cffcmap.h @@ -4,7 +4,7 @@ * * CFF character mapping table (cmap) support (specification). * - * Copyright (C) 2002-2023 by + * Copyright (C) 2002-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/cff/cffdrivr.c b/vendor/freetype/src/cff/cffdrivr.c index 9898d625ca..f6ebdb3810 100644 --- a/vendor/freetype/src/cff/cffdrivr.c +++ b/vendor/freetype/src/cff/cffdrivr.c @@ -4,7 +4,7 @@ * * OpenType font driver implementation (body). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, Werner Lemberg, and Dominik Röttsches. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/cff/cffdrivr.h b/vendor/freetype/src/cff/cffdrivr.h index ab1f147bb2..fd5bc37ecd 100644 --- a/vendor/freetype/src/cff/cffdrivr.h +++ b/vendor/freetype/src/cff/cffdrivr.h @@ -4,7 +4,7 @@ * * High-level OpenType driver interface (specification). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/cff/cfferrs.h b/vendor/freetype/src/cff/cfferrs.h index bc9a3043fc..128adc3b71 100644 --- a/vendor/freetype/src/cff/cfferrs.h +++ b/vendor/freetype/src/cff/cfferrs.h @@ -4,7 +4,7 @@ * * CFF error codes (specification only). * - * Copyright (C) 2001-2023 by + * Copyright (C) 2001-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/cff/cffgload.c b/vendor/freetype/src/cff/cffgload.c index c483d1d1a5..cbb071abdf 100644 --- a/vendor/freetype/src/cff/cffgload.c +++ b/vendor/freetype/src/cff/cffgload.c @@ -4,7 +4,7 @@ * * OpenType Glyph Loader (body). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/cff/cffgload.h b/vendor/freetype/src/cff/cffgload.h index 3b8cf236dd..346d4b11c3 100644 --- a/vendor/freetype/src/cff/cffgload.h +++ b/vendor/freetype/src/cff/cffgload.h @@ -4,7 +4,7 @@ * * OpenType Glyph Loader (specification). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/cff/cffload.c b/vendor/freetype/src/cff/cffload.c index af79082e98..979fd45f6c 100644 --- a/vendor/freetype/src/cff/cffload.c +++ b/vendor/freetype/src/cff/cffload.c @@ -4,7 +4,7 @@ * * OpenType and CFF data/program tables loader (body). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -1202,17 +1202,21 @@ { CFF_AxisCoords* axis = ®ion->axisList[j]; - FT_Int16 start14, peak14, end14; + FT_Int start, peak, end; - if ( FT_READ_SHORT( start14 ) || - FT_READ_SHORT( peak14 ) || - FT_READ_SHORT( end14 ) ) + if ( FT_READ_SHORT( start ) || + FT_READ_SHORT( peak ) || + FT_READ_SHORT( end ) ) goto Exit; - axis->startCoord = FT_fdot14ToFixed( start14 ); - axis->peakCoord = FT_fdot14ToFixed( peak14 ); - axis->endCoord = FT_fdot14ToFixed( end14 ); + /* immediately tag invalid ranges with special peak = 0 */ + if ( ( start < 0 && end > 0 ) || start > peak || peak > end ) + peak = 0; + + axis->startCoord = FT_fdot14ToFixed( start ); + axis->peakCoord = FT_fdot14ToFixed( peak ); + axis->endCoord = FT_fdot14ToFixed( end ); } } @@ -1379,10 +1383,10 @@ /* opcode in both CFF and CFF2 DICTs. See `cff_parse_num' for */ /* decode of this, which rounds to an integer. */ *subFont->blend_top++ = 255; - *subFont->blend_top++ = (FT_Byte)( sum >> 24 ); - *subFont->blend_top++ = (FT_Byte)( sum >> 16 ); - *subFont->blend_top++ = (FT_Byte)( sum >> 8 ); - *subFont->blend_top++ = (FT_Byte)sum; + *subFont->blend_top++ = (FT_Byte)( (FT_UInt32)sum >> 24 ); + *subFont->blend_top++ = (FT_Byte)( (FT_UInt32)sum >> 16 ); + *subFont->blend_top++ = (FT_Byte)( (FT_UInt32)sum >> 8 ); + *subFont->blend_top++ = (FT_Byte)( (FT_UInt32)sum ); } /* leave only numBlends results on parser stack */ @@ -1495,44 +1499,31 @@ for ( j = 0; j < lenNDV; j++ ) { CFF_AxisCoords* axis = &varRegion->axisList[j]; - FT_Fixed axisScalar; - - - /* compute the scalar contribution of this axis; */ - /* ignore invalid ranges */ - if ( axis->startCoord > axis->peakCoord || - axis->peakCoord > axis->endCoord ) - axisScalar = FT_FIXED_ONE; - else if ( axis->startCoord < 0 && - axis->endCoord > 0 && - axis->peakCoord != 0 ) - axisScalar = FT_FIXED_ONE; - /* peak of 0 means ignore this axis */ - else if ( axis->peakCoord == 0 ) - axisScalar = FT_FIXED_ONE; + /* compute the scalar contribution of this axis */ + /* with peak of 0 used for invalid axes */ + if ( axis->peakCoord == NDV[j] || + axis->peakCoord == 0 ) + continue; /* ignore this region if coords are out of range */ - else if ( NDV[j] < axis->startCoord || - NDV[j] > axis->endCoord ) - axisScalar = 0; - - /* calculate a proportional factor */ - else + else if ( NDV[j] <= axis->startCoord || + NDV[j] >= axis->endCoord ) { - if ( NDV[j] == axis->peakCoord ) - axisScalar = FT_FIXED_ONE; - else if ( NDV[j] < axis->peakCoord ) - axisScalar = FT_DivFix( NDV[j] - axis->startCoord, - axis->peakCoord - axis->startCoord ); - else - axisScalar = FT_DivFix( axis->endCoord - NDV[j], - axis->endCoord - axis->peakCoord ); + blend->BV[master] = 0; + break; } - /* take product of all the axis scalars */ - blend->BV[master] = FT_MulFix( blend->BV[master], axisScalar ); + /* adjust proportionally */ + else if ( NDV[j] < axis->peakCoord ) + blend->BV[master] = FT_MulDiv( blend->BV[master], + NDV[j] - axis->startCoord, + axis->peakCoord - axis->startCoord ); + else /* NDV[j] > axis->peakCoord ) */ + blend->BV[master] = FT_MulDiv( blend->BV[master], + axis->endCoord - NDV[j], + axis->endCoord - axis->peakCoord ); } FT_TRACE4(( ", %f ", diff --git a/vendor/freetype/src/cff/cffload.h b/vendor/freetype/src/cff/cffload.h index b5286b0c8c..0220924542 100644 --- a/vendor/freetype/src/cff/cffload.h +++ b/vendor/freetype/src/cff/cffload.h @@ -4,7 +4,7 @@ * * OpenType & CFF data/program tables loader (specification). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/cff/cffobjs.c b/vendor/freetype/src/cff/cffobjs.c index 6d08620c48..7c6713739a 100644 --- a/vendor/freetype/src/cff/cffobjs.c +++ b/vendor/freetype/src/cff/cffobjs.c @@ -4,7 +4,7 @@ * * OpenType objects manager (body). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -42,6 +42,8 @@ #include #include +#define CFF_fixedToInt( x ) \ + ( (FT_Short)( ( (x) + 0x8000U ) >> 16 ) ) /************************************************************************** * @@ -124,19 +126,20 @@ count = priv->num_blue_values = cpriv->num_blue_values; for ( n = 0; n < count; n++ ) - priv->blue_values[n] = (FT_Short)cpriv->blue_values[n]; + priv->blue_values[n] = CFF_fixedToInt( cpriv->blue_values[n] ); count = priv->num_other_blues = cpriv->num_other_blues; for ( n = 0; n < count; n++ ) - priv->other_blues[n] = (FT_Short)cpriv->other_blues[n]; + priv->other_blues[n] = CFF_fixedToInt( cpriv->other_blues[n] ); count = priv->num_family_blues = cpriv->num_family_blues; for ( n = 0; n < count; n++ ) - priv->family_blues[n] = (FT_Short)cpriv->family_blues[n]; + priv->family_blues[n] = CFF_fixedToInt( cpriv->family_blues[n] ); count = priv->num_family_other_blues = cpriv->num_family_other_blues; for ( n = 0; n < count; n++ ) - priv->family_other_blues[n] = (FT_Short)cpriv->family_other_blues[n]; + priv->family_other_blues[n] = + CFF_fixedToInt( cpriv->family_other_blues[n] ); priv->blue_scale = cpriv->blue_scale; priv->blue_shift = (FT_Int)cpriv->blue_shift; @@ -421,32 +424,23 @@ static void remove_subset_prefix( FT_String* name ) { - FT_Int32 idx = 0; - FT_Int32 length = (FT_Int32)ft_strlen( name ) + 1; - FT_Bool continue_search = 1; + FT_UInt32 i = 0, idx = 0; - while ( continue_search ) + /* six ASCII uppercase letters followed by a plus sign */ + while ( 'A' <= name[i] && name[i++] <= 'Z' && + 'A' <= name[i] && name[i++] <= 'Z' && + 'A' <= name[i] && name[i++] <= 'Z' && + 'A' <= name[i] && name[i++] <= 'Z' && + 'A' <= name[i] && name[i++] <= 'Z' && + 'A' <= name[i] && name[i++] <= 'Z' && + name[i++] == '+' ) { - if ( length >= 7 && name[6] == '+' ) - { - for ( idx = 0; idx < 6; idx++ ) - { - /* ASCII uppercase letters */ - if ( !( 'A' <= name[idx] && name[idx] <= 'Z' ) ) - continue_search = 0; - } - - if ( continue_search ) - { - for ( idx = 7; idx < length; idx++ ) - name[idx - 7] = name[idx]; - length -= 7; - } - } - else - continue_search = 0; + idx = i; } + + if ( idx ) + FT_MEM_MOVE( name, name + idx, ft_strlen( name + idx ) + 1 ); } @@ -456,42 +450,20 @@ remove_style( FT_String* family_name, const FT_String* style_name ) { - FT_Int32 family_name_length, style_name_length; + FT_String* f = family_name + ft_strlen( family_name ); + const FT_String* s = style_name + ft_strlen( style_name ); - family_name_length = (FT_Int32)ft_strlen( family_name ); - style_name_length = (FT_Int32)ft_strlen( style_name ); + /* compare strings moving backwards */ + while ( s > style_name ) + if ( f == family_name || *--s != *--f ) + return; - if ( family_name_length > style_name_length ) - { - FT_Int idx; - - - for ( idx = 1; idx <= style_name_length; idx++ ) - { - if ( family_name[family_name_length - idx] != - style_name[style_name_length - idx] ) - break; - } - - if ( idx > style_name_length ) - { - /* family_name ends with style_name; remove it */ - idx = family_name_length - style_name_length - 1; - - /* also remove special characters */ - /* between real family name and style */ - while ( idx > 0 && - ( family_name[idx] == '-' || - family_name[idx] == ' ' || - family_name[idx] == '_' || - family_name[idx] == '+' ) ) - idx--; - - if ( idx > 0 ) - family_name[idx + 1] = '\0'; - } - } + /* terminate and remove special characters */ + do + *f = '\0'; + while ( f-- > family_name && + ( *f == '-' || *f == ' ' || *f == '_' || *f == '+' ) ); } @@ -722,8 +694,7 @@ FT_UInt instance_index = (FT_UInt)face_index >> 16; - if ( FT_HAS_MULTIPLE_MASTERS( cffface ) && - instance_index > 0 ) + if ( FT_HAS_MULTIPLE_MASTERS( cffface ) ) { error = FT_Set_Named_Instance( cffface, instance_index ); if ( error ) diff --git a/vendor/freetype/src/cff/cffobjs.h b/vendor/freetype/src/cff/cffobjs.h index 8f05f6132b..91ad83b1cd 100644 --- a/vendor/freetype/src/cff/cffobjs.h +++ b/vendor/freetype/src/cff/cffobjs.h @@ -4,7 +4,7 @@ * * OpenType objects manager (specification). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/cff/cffparse.c b/vendor/freetype/src/cff/cffparse.c index 3b076704cf..92a69c3b51 100644 --- a/vendor/freetype/src/cff/cffparse.c +++ b/vendor/freetype/src/cff/cffparse.c @@ -4,7 +4,7 @@ * * CFF token stream parser (body) * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -501,10 +501,10 @@ return cff_parse_real( *d, parser->limit, scaling, NULL ); else if ( **d == 255 ) { - FT_Fixed val = ( ( ( (FT_UInt32)*( d[0] + 1 ) << 24 ) | - ( (FT_UInt32)*( d[0] + 2 ) << 16 ) | - ( (FT_UInt32)*( d[0] + 3 ) << 8 ) | - (FT_UInt32)*( d[0] + 4 ) ) ); + FT_Fixed val = (FT_Int32)( ( ( (FT_UInt32)*( d[0] + 1 ) << 24 ) | + ( (FT_UInt32)*( d[0] + 2 ) << 16 ) | + ( (FT_UInt32)*( d[0] + 3 ) << 8 ) | + (FT_UInt32)*( d[0] + 4 ) ) ); if ( scaling ) { @@ -1031,10 +1031,14 @@ CFF_FIELD( code, name, id, cff_kind_string ) #define CFF_FIELD_BOOL( code, name, id ) \ CFF_FIELD( code, name, id, cff_kind_bool ) +#define CFF_FIELD_DELTA( code, name, max, id ) \ + CFF_FIELD_DELTA_KIND( code, name, max, id, cff_kind_delta ) +#define CFF_FIELD_DELTA_FIXED( code, name, max, id ) \ + CFF_FIELD_DELTA_KIND( code, name, max, id, cff_kind_delta_fixed ) #undef CFF_FIELD -#undef CFF_FIELD_DELTA +#undef CFF_FIELD_DELTA_KIND #ifndef FT_DEBUG_LEVEL_TRACE @@ -1064,18 +1068,18 @@ code | CFFCODE, \ FT_FIELD_OFFSET( name ), \ FT_FIELD_SIZE( name ), \ - 0, 0, 0 \ + NULL, 0, 0 \ }, -#define CFF_FIELD_DELTA( code, name, max, id ) \ - { \ - cff_kind_delta, \ - code | CFFCODE, \ - FT_FIELD_OFFSET( name ), \ - FT_FIELD_SIZE_DELTA( name ), \ - 0, \ - max, \ - FT_FIELD_OFFSET( num_ ## name ) \ +#define CFF_FIELD_DELTA_KIND( code, name, max, id, kind ) \ + { \ + kind, \ + code | CFFCODE, \ + FT_FIELD_OFFSET( name ), \ + FT_FIELD_SIZE_DELTA( name ), \ + NULL, \ + max, \ + FT_FIELD_OFFSET( num_ ## name ) \ }, static const CFF_Field_Handler cff_field_handlers[] = @@ -1083,7 +1087,7 @@ #include "cfftoken.h" - { 0, 0, 0, 0, 0, 0, 0 } + { 0, 0, 0, 0, NULL, 0, 0 } }; @@ -1117,20 +1121,20 @@ code | CFFCODE, \ FT_FIELD_OFFSET( name ), \ FT_FIELD_SIZE( name ), \ - 0, 0, 0, \ + NULL, 0, 0, \ id \ }, -#define CFF_FIELD_DELTA( code, name, max, id ) \ - { \ - cff_kind_delta, \ - code | CFFCODE, \ - FT_FIELD_OFFSET( name ), \ - FT_FIELD_SIZE_DELTA( name ), \ - 0, \ - max, \ - FT_FIELD_OFFSET( num_ ## name ), \ - id \ +#define CFF_FIELD_DELTA_KIND( code, name, max, id, kind ) \ + { \ + kind, \ + code | CFFCODE, \ + FT_FIELD_OFFSET( name ), \ + FT_FIELD_SIZE_DELTA( name ), \ + NULL, \ + max, \ + FT_FIELD_OFFSET( num_ ## name ), \ + id \ }, static const CFF_Field_Handler cff_field_handlers[] = @@ -1138,7 +1142,7 @@ #include "cfftoken.h" - { 0, 0, 0, 0, 0, 0, 0, 0 } + { 0, 0, 0, 0, NULL, 0, 0, NULL } }; @@ -1356,7 +1360,8 @@ /* check that we have enough arguments -- except for */ /* delta encoded arrays, which can be empty */ - if ( field->kind != cff_kind_delta && num_args < 1 ) + if ( field->kind != cff_kind_delta && + field->kind != cff_kind_delta_fixed && num_args < 1 ) goto Stack_Underflow; switch ( field->kind ) @@ -1471,6 +1476,38 @@ } break; + case cff_kind_delta_fixed: + { + FT_Byte* qcount = (FT_Byte*)parser->object + + field->count_offset; + + FT_Byte** data = parser->stack; + + + if ( num_args > field->array_max ) + num_args = field->array_max; + + FT_TRACE4(( " [" )); + + /* store count */ + *qcount = (FT_Byte)num_args; + + val = 0; + while ( num_args > 0 ) + { + val = ADD_LONG( val, cff_parse_fixed( parser, data++ ) ); + *(FT_Long*)q = val; + + FT_TRACE4(( " %f\n", (double)val / 65536 )); + + q += field->size; + num_args--; + } + + FT_TRACE4(( "]\n" )); + } + break; + default: /* callback or blend */ error = field->reader( parser ); if ( error ) diff --git a/vendor/freetype/src/cff/cffparse.h b/vendor/freetype/src/cff/cffparse.h index 418caacc68..ca6b18af6a 100644 --- a/vendor/freetype/src/cff/cffparse.h +++ b/vendor/freetype/src/cff/cffparse.h @@ -4,7 +4,7 @@ * * CFF token stream parser (specification) * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -107,6 +107,7 @@ FT_BEGIN_HEADER cff_kind_string, cff_kind_bool, cff_kind_delta, + cff_kind_delta_fixed, cff_kind_callback, cff_kind_blend, diff --git a/vendor/freetype/src/cff/cfftoken.h b/vendor/freetype/src/cff/cfftoken.h index b61cb0e66e..da45faa7f4 100644 --- a/vendor/freetype/src/cff/cfftoken.h +++ b/vendor/freetype/src/cff/cfftoken.h @@ -4,7 +4,7 @@ * * CFF token definitions (specification only). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -80,26 +80,26 @@ #undef CFFCODE #define CFFCODE CFF_CODE_PRIVATE - CFF_FIELD_DELTA ( 6, blue_values, 14, "BlueValues" ) - CFF_FIELD_DELTA ( 7, other_blues, 10, "OtherBlues" ) - CFF_FIELD_DELTA ( 8, family_blues, 14, "FamilyBlues" ) - CFF_FIELD_DELTA ( 9, family_other_blues, 10, "FamilyOtherBlues" ) - CFF_FIELD_FIXED_1000( 0x109, blue_scale, "BlueScale" ) - CFF_FIELD_NUM ( 0x10A, blue_shift, "BlueShift" ) - CFF_FIELD_NUM ( 0x10B, blue_fuzz, "BlueFuzz" ) - CFF_FIELD_NUM ( 10, standard_width, "StdHW" ) - CFF_FIELD_NUM ( 11, standard_height, "StdVW" ) - CFF_FIELD_DELTA ( 0x10C, snap_widths, 13, "StemSnapH" ) - CFF_FIELD_DELTA ( 0x10D, snap_heights, 13, "StemSnapV" ) - CFF_FIELD_BOOL ( 0x10E, force_bold, "ForceBold" ) - CFF_FIELD_FIXED ( 0x10F, force_bold_threshold, "ForceBoldThreshold" ) - CFF_FIELD_NUM ( 0x110, lenIV, "lenIV" ) - CFF_FIELD_NUM ( 0x111, language_group, "LanguageGroup" ) - CFF_FIELD_FIXED ( 0x112, expansion_factor, "ExpansionFactor" ) - CFF_FIELD_NUM ( 0x113, initial_random_seed, "initialRandomSeed" ) - CFF_FIELD_NUM ( 19, local_subrs_offset, "Subrs" ) - CFF_FIELD_NUM ( 20, default_width, "defaultWidthX" ) - CFF_FIELD_NUM ( 21, nominal_width, "nominalWidthX" ) + CFF_FIELD_DELTA_FIXED( 6, blue_values, 14, "BlueValues" ) + CFF_FIELD_DELTA_FIXED( 7, other_blues, 10, "OtherBlues" ) + CFF_FIELD_DELTA_FIXED( 8, family_blues, 14, "FamilyBlues" ) + CFF_FIELD_DELTA_FIXED( 9, family_other_blues, 10, "FamilyOtherBlues" ) + CFF_FIELD_FIXED_1000 ( 0x109, blue_scale, "BlueScale" ) + CFF_FIELD_NUM ( 0x10A, blue_shift, "BlueShift" ) + CFF_FIELD_NUM ( 0x10B, blue_fuzz, "BlueFuzz" ) + CFF_FIELD_NUM ( 10, standard_width, "StdHW" ) + CFF_FIELD_NUM ( 11, standard_height, "StdVW" ) + CFF_FIELD_DELTA ( 0x10C, snap_widths, 13, "StemSnapH" ) + CFF_FIELD_DELTA ( 0x10D, snap_heights, 13, "StemSnapV" ) + CFF_FIELD_BOOL ( 0x10E, force_bold, "ForceBold" ) + CFF_FIELD_FIXED ( 0x10F, force_bold_threshold, "ForceBoldThreshold" ) + CFF_FIELD_NUM ( 0x110, lenIV, "lenIV" ) + CFF_FIELD_NUM ( 0x111, language_group, "LanguageGroup" ) + CFF_FIELD_FIXED ( 0x112, expansion_factor, "ExpansionFactor" ) + CFF_FIELD_NUM ( 0x113, initial_random_seed, "initialRandomSeed" ) + CFF_FIELD_NUM ( 19, local_subrs_offset, "Subrs" ) + CFF_FIELD_NUM ( 20, default_width, "defaultWidthX" ) + CFF_FIELD_NUM ( 21, nominal_width, "nominalWidthX" ) #undef FT_STRUCTURE @@ -129,22 +129,22 @@ #undef CFFCODE #define CFFCODE CFF2_CODE_PRIVATE - CFF_FIELD_DELTA ( 6, blue_values, 14, "BlueValues" ) - CFF_FIELD_DELTA ( 7, other_blues, 10, "OtherBlues" ) - CFF_FIELD_DELTA ( 8, family_blues, 14, "FamilyBlues" ) - CFF_FIELD_DELTA ( 9, family_other_blues, 10, "FamilyOtherBlues" ) - CFF_FIELD_FIXED_1000( 0x109, blue_scale, "BlueScale" ) - CFF_FIELD_NUM ( 0x10A, blue_shift, "BlueShift" ) - CFF_FIELD_NUM ( 0x10B, blue_fuzz, "BlueFuzz" ) - CFF_FIELD_NUM ( 10, standard_width, "StdHW" ) - CFF_FIELD_NUM ( 11, standard_height, "StdVW" ) - CFF_FIELD_DELTA ( 0x10C, snap_widths, 13, "StemSnapH" ) - CFF_FIELD_DELTA ( 0x10D, snap_heights, 13, "StemSnapV" ) - CFF_FIELD_NUM ( 0x111, language_group, "LanguageGroup" ) - CFF_FIELD_FIXED ( 0x112, expansion_factor, "ExpansionFactor" ) - CFF_FIELD_CALLBACK ( 22, vsindex, "vsindex" ) - CFF_FIELD_BLEND ( 23, "blend" ) - CFF_FIELD_NUM ( 19, local_subrs_offset, "Subrs" ) + CFF_FIELD_DELTA_FIXED( 6, blue_values, 14, "BlueValues" ) + CFF_FIELD_DELTA_FIXED( 7, other_blues, 10, "OtherBlues" ) + CFF_FIELD_DELTA_FIXED( 8, family_blues, 14, "FamilyBlues" ) + CFF_FIELD_DELTA_FIXED( 9, family_other_blues, 10, "FamilyOtherBlues" ) + CFF_FIELD_FIXED_1000 ( 0x109, blue_scale, "BlueScale" ) + CFF_FIELD_NUM ( 0x10A, blue_shift, "BlueShift" ) + CFF_FIELD_NUM ( 0x10B, blue_fuzz, "BlueFuzz" ) + CFF_FIELD_NUM ( 10, standard_width, "StdHW" ) + CFF_FIELD_NUM ( 11, standard_height, "StdVW" ) + CFF_FIELD_DELTA ( 0x10C, snap_widths, 13, "StemSnapH" ) + CFF_FIELD_DELTA ( 0x10D, snap_heights, 13, "StemSnapV" ) + CFF_FIELD_NUM ( 0x111, language_group, "LanguageGroup" ) + CFF_FIELD_FIXED ( 0x112, expansion_factor, "ExpansionFactor" ) + CFF_FIELD_CALLBACK ( 22, vsindex, "vsindex" ) + CFF_FIELD_BLEND ( 23, "blend" ) + CFF_FIELD_NUM ( 19, local_subrs_offset, "Subrs" ) /* END */ diff --git a/vendor/freetype/src/cid/ciderrs.h b/vendor/freetype/src/cid/ciderrs.h index 40a1097d0a..c439a8c4a0 100644 --- a/vendor/freetype/src/cid/ciderrs.h +++ b/vendor/freetype/src/cid/ciderrs.h @@ -4,7 +4,7 @@ * * CID error codes (specification only). * - * Copyright (C) 2001-2023 by + * Copyright (C) 2001-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/cid/cidgload.c b/vendor/freetype/src/cid/cidgload.c index eaca765ad0..7b571322d4 100644 --- a/vendor/freetype/src/cid/cidgload.c +++ b/vendor/freetype/src/cid/cidgload.c @@ -4,7 +4,7 @@ * * CID-keyed Type1 Glyph Loader (body). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/cid/cidgload.h b/vendor/freetype/src/cid/cidgload.h index edd6229234..9fdc9db589 100644 --- a/vendor/freetype/src/cid/cidgload.h +++ b/vendor/freetype/src/cid/cidgload.h @@ -4,7 +4,7 @@ * * OpenType Glyph Loader (specification). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/cid/cidload.c b/vendor/freetype/src/cid/cidload.c index a7da8ea39d..722f5a34dd 100644 --- a/vendor/freetype/src/cid/cidload.c +++ b/vendor/freetype/src/cid/cidload.c @@ -4,7 +4,7 @@ * * CID-keyed Type1 font loader (body). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -388,7 +388,7 @@ T1_FIELD_CALLBACK( "ExpansionFactor", parse_expansion_factor, 0 ) T1_FIELD_CALLBACK( "FontName", parse_font_name, 0 ) - { 0, T1_FIELD_LOCATION_CID_INFO, T1_FIELD_TYPE_NONE, 0, 0, 0, 0, 0, 0 } + T1_FIELD_ZERO }; @@ -469,36 +469,23 @@ T1_Field keyword = (T1_Field)cid_field_records; - for (;;) + while ( keyword->len ) { - FT_Byte* name; + FT_Byte* name = (FT_Byte*)keyword->ident; - name = (FT_Byte*)keyword->ident; - if ( !name ) - break; - - if ( cur[0] == name[0] && - len == ft_strlen( (const char*)name ) ) + if ( keyword->len == len && + ft_memcmp( cur, name, len ) == 0 ) { - FT_UInt n; - - - for ( n = 1; n < len; n++ ) - if ( cur[n] != name[n] ) - break; - - if ( n >= len ) - { - /* we found it - run the parsing callback */ - parser->root.error = cid_load_keyword( face, - loader, - keyword ); - if ( parser->root.error ) - return parser->root.error; - break; - } + /* we found it - run the parsing callback */ + parser->root.error = cid_load_keyword( face, + loader, + keyword ); + if ( parser->root.error ) + return parser->root.error; + break; } + keyword++; } } diff --git a/vendor/freetype/src/cid/cidload.h b/vendor/freetype/src/cid/cidload.h index d12d2962a6..7f030b32df 100644 --- a/vendor/freetype/src/cid/cidload.h +++ b/vendor/freetype/src/cid/cidload.h @@ -4,7 +4,7 @@ * * CID-keyed Type1 font loader (specification). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/cid/cidobjs.c b/vendor/freetype/src/cid/cidobjs.c index f698a41928..8d337c4112 100644 --- a/vendor/freetype/src/cid/cidobjs.c +++ b/vendor/freetype/src/cid/cidobjs.c @@ -4,7 +4,7 @@ * * CID objects manager (body). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/cid/cidobjs.h b/vendor/freetype/src/cid/cidobjs.h index 83c0c61c3c..d371cbe995 100644 --- a/vendor/freetype/src/cid/cidobjs.h +++ b/vendor/freetype/src/cid/cidobjs.h @@ -4,7 +4,7 @@ * * CID objects manager (specification). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/cid/cidparse.c b/vendor/freetype/src/cid/cidparse.c index 171a886215..73a3ade893 100644 --- a/vendor/freetype/src/cid/cidparse.c +++ b/vendor/freetype/src/cid/cidparse.c @@ -4,7 +4,7 @@ * * CID-keyed Type1 parser (body). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -90,10 +90,15 @@ if ( error ) goto Exit; - Again: - /* now, read the rest of the file until we find */ - /* `StartData' or `/sfnts' */ + if ( !stream->read ) { + /* just parse memory-based streams */ + offset = stream->size; + } + else { + /* Find the last `StartData` or `/sfnts`. The parser requires */ + /* contiguous memory; attempt to pin as little as necessary. */ + /* * The algorithm is as follows (omitting the case with less than 256 * bytes to fill for simplicity). @@ -119,7 +124,8 @@ FT_Byte* p = buffer; - for ( offset = FT_STREAM_POS(); ; offset += 256 ) + offset = 0; + while ( 1 ) { FT_ULong stream_len; @@ -127,7 +133,7 @@ stream_len = stream->size - FT_STREAM_POS(); read_len = FT_MIN( read_len, stream_len ); - if ( FT_STREAM_READ( p, read_len ) ) + if ( read_len && FT_STREAM_READ( p, read_len ) ) goto Exit; /* ensure that we do not compare with data beyond the buffer */ @@ -141,20 +147,23 @@ ft_strncmp( (char*)p, STARTDATA, STARTDATA_LEN ) == 0 ) { /* save offset of binary data after `StartData' */ - offset += (FT_ULong)( p - buffer ) + STARTDATA_LEN + 1; - goto Found; + offset = FT_STREAM_POS() - read_len - read_offset + + (FT_ULong)( p - buffer ) + STARTDATA_LEN + 1; } else if ( p[1] == 's' && ft_strncmp( (char*)p, SFNTS, SFNTS_LEN ) == 0 ) { - offset += (FT_ULong)( p - buffer ) + SFNTS_LEN + 1; - goto Found; + offset = FT_STREAM_POS() - read_len - read_offset + + (FT_ULong)( p - buffer ) + SFNTS_LEN + 1; } } - if ( read_offset + read_len < STARTDATA_LEN ) + if ( read_offset + read_len <= STARTDATA_LEN ) { - FT_TRACE2(( "cid_parser_new: no `StartData' keyword found\n" )); + if ( offset ) + goto Found; + + FT_TRACE2(( "cid_parser_new: no `StartData` keyword found\n" )); error = FT_THROW( Invalid_File_Format ); goto Exit; } @@ -171,9 +180,9 @@ } Found: - /* We have found the start of the binary data or the `/sfnts' token. */ - /* Now rewind and extract the frame corresponding to this PostScript */ - /* section. */ + /* We have found an efficient range to look for the binary data or */ + /* `/sfnts' token. Now rewind and extract the frame corresponding to */ + /* this PostScript section. */ ps_len = offset - base_offset; if ( FT_STREAM_SEEK( base_offset ) || @@ -187,8 +196,8 @@ parser->root.limit = parser->root.cursor + ps_len; parser->num_dict = FT_UINT_MAX; - /* Finally, we check whether `StartData' or `/sfnts' was real -- */ - /* it could be in a comment or string. We also get the arguments */ + /* Find the first real `StartData' or `/sfnts' -- the last one */ + /* could be in a comment or string. We also get the arguments */ /* of `StartData' to find out whether the data is represented in */ /* binary or hex format. */ @@ -216,6 +225,7 @@ { T1_TokenRec type_token; FT_Long binary_length; + FT_ULong found_offset; parser->root.cursor = arg1; @@ -234,6 +244,24 @@ parser->binary_length = (FT_ULong)binary_length; } + /* set the real values for the parser, if different */ + found_offset = (FT_ULong)( cur - parser->postscript ) + + STARTDATA_LEN + 1; + if ( found_offset != offset ) + { + FT_FRAME_RELEASE( parser->postscript ); + + ps_len = found_offset - base_offset; + if ( FT_STREAM_SEEK( base_offset ) || + FT_FRAME_EXTRACT( ps_len, parser->postscript ) ) + goto Exit; + + parser->data_offset = found_offset; + parser->postscript_len = ps_len; + parser->root.base = parser->postscript; + parser->root.cursor = parser->postscript; + parser->root.limit = parser->root.cursor + ps_len; + } goto Exit; } else if ( cur[1] == 's' && @@ -251,11 +279,8 @@ cur = parser->root.cursor; } - /* we haven't found the correct `StartData'; go back and continue */ - /* searching */ - FT_FRAME_RELEASE( parser->postscript ); - if ( !FT_STREAM_SEEK( offset ) ) - goto Again; + FT_TRACE2(( "cid_parser_new: no `StartData` token found\n" )); + error = FT_THROW( Invalid_File_Format ); Exit: return error; diff --git a/vendor/freetype/src/cid/cidparse.h b/vendor/freetype/src/cid/cidparse.h index 2fd4e7a931..0f5baddcb9 100644 --- a/vendor/freetype/src/cid/cidparse.h +++ b/vendor/freetype/src/cid/cidparse.h @@ -4,7 +4,7 @@ * * CID-keyed Type1 parser (specification). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/cid/cidriver.c b/vendor/freetype/src/cid/cidriver.c index 99e7b11839..4be8a5c00d 100644 --- a/vendor/freetype/src/cid/cidriver.c +++ b/vendor/freetype/src/cid/cidriver.c @@ -4,7 +4,7 @@ * * CID driver interface (body). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/cid/cidriver.h b/vendor/freetype/src/cid/cidriver.h index a6249385c8..7ddce431c5 100644 --- a/vendor/freetype/src/cid/cidriver.h +++ b/vendor/freetype/src/cid/cidriver.h @@ -4,7 +4,7 @@ * * High-level CID driver interface (specification). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/cid/cidtoken.h b/vendor/freetype/src/cid/cidtoken.h index 925951acdb..160897d144 100644 --- a/vendor/freetype/src/cid/cidtoken.h +++ b/vendor/freetype/src/cid/cidtoken.h @@ -4,7 +4,7 @@ * * CID token definitions (specification only). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/cid/type1cid.c b/vendor/freetype/src/cid/type1cid.c index 905c896a31..890a3ac549 100644 --- a/vendor/freetype/src/cid/type1cid.c +++ b/vendor/freetype/src/cid/type1cid.c @@ -4,7 +4,7 @@ * * FreeType OpenType driver component (body only). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/dlg/dlg.c b/vendor/freetype/src/dlg/dlg.c deleted file mode 100644 index 0e6bc74b6c..0000000000 --- a/vendor/freetype/src/dlg/dlg.c +++ /dev/null @@ -1,803 +0,0 @@ -// Copyright (c) 2019 nyorain -// Distributed under the Boost Software License, Version 1.0. -// See accompanying file LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt - -#define _XOPEN_SOURCE 600 -#define _POSIX_C_SOURCE 200809L -#define _WIN32_WINNT 0x0600 - -// Needed on windows so that we can use sprintf without warning. -#define _CRT_SECURE_NO_WARNINGS - -#include -#include -#include -#include -#include -#include -#include - -const char* const dlg_reset_sequence = "\033[0m"; -const struct dlg_style dlg_default_output_styles[] = { - {dlg_text_style_italic, dlg_color_green, dlg_color_none}, - {dlg_text_style_dim, dlg_color_gray, dlg_color_none}, - {dlg_text_style_none, dlg_color_cyan, dlg_color_none}, - {dlg_text_style_none, dlg_color_yellow, dlg_color_none}, - {dlg_text_style_none, dlg_color_red, dlg_color_none}, - {dlg_text_style_bold, dlg_color_red, dlg_color_none} -}; - -static void* xalloc(size_t size) { - void* ret = calloc(size, 1); - if(!ret) fprintf(stderr, "dlg: calloc returned NULL, probably crashing (size: %zu)\n", size); - return ret; -} - -static void* xrealloc(void* ptr, size_t size) { - void* ret = realloc(ptr, size); - if(!ret) fprintf(stderr, "dlg: realloc returned NULL, probably crashing (size: %zu)\n", size); - return ret; -} - -struct dlg_tag_func_pair { - const char* tag; - const char* func; -}; - -struct dlg_data { - const char** tags; // vec - struct dlg_tag_func_pair* pairs; // vec - char* buffer; - size_t buffer_size; -}; - -static dlg_handler g_handler = dlg_default_output; -static void* g_data = NULL; - -static void dlg_free_data(void* data); -static struct dlg_data* dlg_create_data(void); - -// platform-specific -#if defined(__unix__) || defined(__unix) || defined(__linux__) || defined(__APPLE__) || defined(__MACH__) - #define DLG_OS_UNIX - #include - #include - #include - - static pthread_key_t dlg_data_key; - - static void dlg_main_cleanup(void) { - void* data = pthread_getspecific(dlg_data_key); - if(data) { - dlg_free_data(data); - pthread_setspecific(dlg_data_key, NULL); - } - } - - static void init_data_key(void) { - pthread_key_create(&dlg_data_key, dlg_free_data); - atexit(dlg_main_cleanup); - } - - static struct dlg_data* dlg_data(void) { - static pthread_once_t key_once = PTHREAD_ONCE_INIT; - pthread_once(&key_once, init_data_key); - - void* data = pthread_getspecific(dlg_data_key); - if(!data) { - data = dlg_create_data(); - pthread_setspecific(dlg_data_key, data); - } - - return (struct dlg_data*) data; - } - - static void lock_file(FILE* file) { - flockfile(file); - } - - static void unlock_file(FILE* file) { - funlockfile(file); - } - - bool dlg_is_tty(FILE* stream) { - return isatty(fileno(stream)); - } - - static unsigned get_msecs(void) { - struct timeval tv; - gettimeofday(&tv, NULL); - return tv.tv_usec; - } - -// platform switch -- end unix -#elif defined(WIN32) || defined(_WIN32) || defined(_WIN64) - #define DLG_OS_WIN - #define WIN32_LEAN_AND_MEAN - #define DEFINE_CONSOLEV2_PROPERTIES - #include - #include - - // thanks for nothing, microsoft - #ifndef ENABLE_VIRTUAL_TERMINAL_PROCESSING - #define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x0004 - #endif - - // the max buffer size we will convert on the stack - #define DLG_MAX_STACK_BUF_SIZE 1024 - - static void WINAPI dlg_fls_destructor(void* data) { - dlg_free_data(data); - } - - // TODO: error handling - static BOOL CALLBACK dlg_init_fls(PINIT_ONCE io, void* param, void** lpContext) { - (void) io; - (void) param; - **((DWORD**) lpContext) = FlsAlloc(dlg_fls_destructor); - return true; - } - - static struct dlg_data* dlg_data(void) { - static INIT_ONCE init_once = INIT_ONCE_STATIC_INIT; - static DWORD fls = 0; - void* flsp = (void*) &fls; - InitOnceExecuteOnce(&init_once, dlg_init_fls, NULL, &flsp); - void* data = FlsGetValue(fls); - if(!data) { - data = dlg_create_data(); - FlsSetValue(fls, data); - } - - return (struct dlg_data*) data; - } - - static void lock_file(FILE* file) { - _lock_file(file); - } - - static void unlock_file(FILE* file) { - _unlock_file(file); - } - - bool dlg_is_tty(FILE* stream) { - return _isatty(_fileno(stream)); - } - -#ifdef DLG_WIN_CONSOLE - static bool init_ansi_console(void) { - HANDLE out = GetStdHandle(STD_OUTPUT_HANDLE); - HANDLE err = GetStdHandle(STD_ERROR_HANDLE); - if(out == INVALID_HANDLE_VALUE || err == INVALID_HANDLE_VALUE) - return false; - - DWORD outMode, errMode; - if(!GetConsoleMode(out, &outMode) || !GetConsoleMode(err, &errMode)) - return false; - - outMode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING; - errMode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING; - if(!SetConsoleMode(out, outMode) || !SetConsoleMode(out, errMode)) - return false; - - return true; - } - - static bool win_write_heap(void* handle, int needed, const char* format, va_list args) { - char* buf1 = xalloc(3 * needed + 3 + (needed % 2)); - wchar_t* buf2 = (wchar_t*) (buf1 + needed + 1 + (needed % 2)); - vsnprintf(buf1, needed + 1, format, args); - needed = MultiByteToWideChar(CP_UTF8, 0, buf1, needed, buf2, needed + 1); - bool ret = (needed != 0 && WriteConsoleW(handle, buf2, needed, NULL, NULL) != 0); - free(buf1); - return ret; - } - - static bool win_write_stack(void* handle, int needed, const char* format, va_list args) { - char buf1[DLG_MAX_STACK_BUF_SIZE]; - wchar_t buf2[DLG_MAX_STACK_BUF_SIZE]; - vsnprintf(buf1, needed + 1, format, args); - needed = MultiByteToWideChar(CP_UTF8, 0, buf1, needed, buf2, needed + 1); - return (needed != 0 && WriteConsoleW(handle, buf2, needed, NULL, NULL) != 0); - } -#endif // DLG_WIN_CONSOLE - - static unsigned get_msecs() { - SYSTEMTIME st; - GetSystemTime(&st); - return st.wMilliseconds; - } - -#else // platform switch -- end windows - #error Cannot determine platform (needed for color and utf-8 and stuff) -#endif - -// general -void dlg_escape_sequence(struct dlg_style style, char buf[12]) { - int nums[3]; - unsigned int count = 0; - - if(style.fg != dlg_color_none) { - nums[count++] = style.fg + 30; - } - - if(style.bg != dlg_color_none) { - nums[count++] = style.fg + 40; - } - - if(style.style != dlg_text_style_none) { - nums[count++] = style.style; - } - - switch(count) { - case 1: snprintf(buf, 12, "\033[%dm", nums[0]); break; - case 2: snprintf(buf, 12, "\033[%d;%dm", nums[0], nums[1]); break; - case 3: snprintf(buf, 12, "\033[%d;%d;%dm", nums[0], nums[1], nums[2]); break; - default: buf[0] = '\0'; break; - } -} - -int dlg_vfprintf(FILE* stream, const char* format, va_list args) { -#if defined(DLG_OS_WIN) && defined(DLG_WIN_CONSOLE) - void* handle = NULL; - if(stream == stdout) { - handle = GetStdHandle(STD_OUTPUT_HANDLE); - } else if(stream == stderr) { - handle = GetStdHandle(STD_ERROR_HANDLE); - } - - if(handle) { - va_list args_copy; - va_copy(args_copy, args); - int needed = vsnprintf(NULL, 0, format, args_copy); - va_end(args_copy); - - if(needed < 0) { - return needed; - } - - // We don't allocate too much on the stack - // but we also don't want to call alloc every logging call - // or use another cached buffer - if(needed >= DLG_MAX_STACK_BUF_SIZE) { - if(win_write_heap(handle, needed, format, args)) { - return needed; - } - } else { - if(win_write_stack(handle, needed, format, args)) { - return needed; - } - } - } -#endif - - return vfprintf(stream, format, args); -} - -int dlg_fprintf(FILE* stream, const char* format, ...) { - va_list args; - va_start(args, format); - int ret = dlg_vfprintf(stream, format, args); - va_end(args); - return ret; -} - -int dlg_styled_fprintf(FILE* stream, struct dlg_style style, const char* format, ...) { - char buf[12]; - dlg_escape_sequence(style, buf); - - fprintf(stream, "%s", buf); - va_list args; - va_start(args, format); - int ret = dlg_vfprintf(stream, format, args); - va_end(args); - fprintf(stream, "%s", dlg_reset_sequence); - return ret; -} - -void dlg_generic_output(dlg_generic_output_handler output, void* data, - unsigned int features, const struct dlg_origin* origin, const char* string, - const struct dlg_style styles[6]) { - // We never print any dynamic content below so we can be sure at compile - // time that a buffer of size 64 is large enough. - char format_buf[64]; - char* format = format_buf; - - if(features & dlg_output_style) { - format += sprintf(format, "%%s"); - } - - if(features & (dlg_output_time | dlg_output_file_line | dlg_output_tags | dlg_output_func)) { - format += sprintf(format, "["); - } - - bool first_meta = true; - if(features & dlg_output_time) { - format += sprintf(format, "%%h"); - first_meta = false; - } - - if(features & dlg_output_time_msecs) { - if(!first_meta) { - format += sprintf(format, ":"); - } - - format += sprintf(format, "%%m"); - first_meta = false; - } - - if(features & dlg_output_file_line) { - if(!first_meta) { - format += sprintf(format, " "); - } - - format += sprintf(format, "%%o"); - first_meta = false; - } - - if(features & dlg_output_func) { - if(!first_meta) { - format += sprintf(format, " "); - } - - format += sprintf(format, "%%f"); - first_meta = false; - } - - if(features & dlg_output_tags) { - if(!first_meta) { - format += sprintf(format, " "); - } - - format += sprintf(format, "{%%t}"); - first_meta = false; - } - - if(features & (dlg_output_time | dlg_output_file_line | dlg_output_tags | dlg_output_func)) { - format += sprintf(format, "] "); - } - - format += sprintf(format, "%%c"); - - if(features & dlg_output_newline) { - format += sprintf(format, "\n"); - } - - *format = '\0'; - dlg_generic_outputf(output, data, format_buf, origin, string, styles); -} - -void dlg_generic_outputf(dlg_generic_output_handler output, void* data, - const char* format_string, const struct dlg_origin* origin, const char* string, - const struct dlg_style styles[6]) { - bool reset_style = false; - for(const char* it = format_string; *it; it++) { - if(*it != '%') { - output(data, "%c", *it); - continue; - } - - char next = *(it + 1); // must be valid since *it is not '\0' - if(next == 'h') { - time_t t = time(NULL); - struct tm tm_info; - - #ifdef DLG_OS_WIN - if(localtime_s(&tm_info, &t)) { - #else - if(!localtime_r(&t, &tm_info)) { - #endif - output(data, ""); - } else { - char timebuf[32]; - strftime(timebuf, sizeof(timebuf), "%H:%M:%S", &tm_info); - output(data, "%s", timebuf); - } - it++; - } else if(next == 'm') { - output(data, "%06d", get_msecs()); - it++; - } else if(next == 't') { - bool first_tag = true; - for(const char** tags = origin->tags; *tags; ++tags) { - if(!first_tag) { - output(data, ", "); - } - - output(data, "%s", *tags); - first_tag = false; - } - ++it; - } else if(next == 'f') { - output(data, "%s", origin->func); - ++it; - } else if(next == 'o') { - output(data, "%s:%u", origin->file, origin->line); - ++it; - } else if(next == 's') { - char buf[12]; - dlg_escape_sequence(styles[origin->level], buf); - output(data, "%s", buf); - reset_style = true; - ++it; - } else if(next == 'r') { - output(data, "%s", dlg_reset_sequence); - reset_style = false; - ++it; - } else if(next == 'c') { - if(origin->expr && string) { - output(data, "assertion '%s' failed: '%s'", origin->expr, string); - } else if(origin->expr) { - output(data, "assertion '%s' failed", origin->expr); - } else if(string) { - output(data, "%s", string); - } - ++it; - } else if(next == '%') { - output(data, "%s", "%"); - ++it; - } else { - // in this case it's a '%' without known format specifier following - output(data, "%s", "%"); - } - } - - if(reset_style) { - output(data, "%s", dlg_reset_sequence); - } -} - -struct buf { - char* buf; - size_t* size; -}; - -static void print_size(void* size, const char* format, ...) { - va_list args; - va_start(args, format); - - int ret = vsnprintf(NULL, 0, format, args); - va_end(args); - - if(ret > 0) { - *((size_t*) size) += ret; - } -} - -static void print_buf(void* dbuf, const char* format, ...) { - struct buf* buf = (struct buf*) dbuf; - va_list args; - va_start(args, format); - - int printed = vsnprintf(buf->buf, *buf->size, format, args); - va_end(args); - - if(printed > 0) { - *buf->size -= printed; - buf->buf += printed; - } -} - -void dlg_generic_output_buf(char* buf, size_t* size, unsigned int features, - const struct dlg_origin* origin, const char* string, - const struct dlg_style styles[6]) { - if(buf) { - struct buf mbuf; - mbuf.buf = buf; - mbuf.size = size; - dlg_generic_output(print_buf, &mbuf, features, origin, string, styles); - } else { - *size = 0; - dlg_generic_output(print_size, size, features, origin, string, styles); - } -} - -void dlg_generic_outputf_buf(char* buf, size_t* size, const char* format_string, - const struct dlg_origin* origin, const char* string, - const struct dlg_style styles[6]) { - if(buf) { - struct buf mbuf; - mbuf.buf = buf; - mbuf.size = size; - dlg_generic_outputf(print_buf, &mbuf, format_string, origin, string, styles); - } else { - *size = 0; - dlg_generic_outputf(print_size, size, format_string, origin, string, styles); - } -} - -static void print_stream(void* stream, const char* format, ...) { - va_list args; - va_start(args, format); - dlg_vfprintf((FILE*) stream, format, args); - va_end(args); -} - -void dlg_generic_output_stream(FILE* stream, unsigned int features, - const struct dlg_origin* origin, const char* string, - const struct dlg_style styles[6]) { - stream = stream ? stream : stdout; - if(features & dlg_output_threadsafe) { - lock_file(stream); - } - - dlg_generic_output(print_stream, stream, features, origin, string, styles); - if(features & dlg_output_threadsafe) { - unlock_file(stream); - } -} - -void dlg_generic_outputf_stream(FILE* stream, const char* format_string, - const struct dlg_origin* origin, const char* string, - const struct dlg_style styles[6], bool lock_stream) { - stream = stream ? stream : stdout; - if(lock_stream) { - lock_file(stream); - } - - dlg_generic_outputf(print_stream, stream, format_string, origin, string, styles); - if(lock_stream) { - unlock_file(stream); - } -} - -void dlg_default_output(const struct dlg_origin* origin, const char* string, void* data) { - FILE* stream = data ? (FILE*) data : stdout; - unsigned int features = dlg_output_file_line | - dlg_output_newline | - dlg_output_threadsafe; - -#ifdef DLG_DEFAULT_OUTPUT_ALWAYS_COLOR - dlg_win_init_ansi(); - features |= dlg_output_style; -#else - if(dlg_is_tty(stream) && dlg_win_init_ansi()) { - features |= dlg_output_style; - } -#endif - - dlg_generic_output_stream(stream, features, origin, string, dlg_default_output_styles); - fflush(stream); -} - -bool dlg_win_init_ansi(void) { -#if defined(DLG_OS_WIN) && defined(DLG_WIN_CONSOLE) - // TODO: use init once - static volatile LONG status = 0; - LONG res = InterlockedCompareExchange(&status, 1, 0); - if(res == 0) { // not initialized - InterlockedExchange(&status, 3 + init_ansi_console()); - } - - while(status == 1); // currently initialized in another thread, spinlock - return (status == 4); -#else - return true; -#endif -} - -// small dynamic vec/array implementation -// Since the macros vec_init and vec_add[c]/vec_push might -// change the pointers value it must not be referenced somewhere else. -#define vec__raw(vec) (((unsigned int*) vec) - 2) - -static void* vec_do_create(unsigned int typesize, unsigned int cap, unsigned int size) { - unsigned long a = (size > cap) ? size : cap; - void* ptr = xalloc(2 * sizeof(unsigned int) + a * typesize); - unsigned int* begin = (unsigned int*) ptr; - begin[0] = size * typesize; - begin[1] = a * typesize; - return begin + 2; -} - -// NOTE: can be more efficient if we are allowed to reorder vector -static void vec_do_erase(void* vec, unsigned int pos, unsigned int size) { - unsigned int* begin = vec__raw(vec); - begin[0] -= size; - char* buf = (char*) vec; - memcpy(buf + pos, buf + pos + size, size); -} - -static void* vec_do_add(void** vec, unsigned int size) { - unsigned int* begin = vec__raw(*vec); - unsigned int needed = begin[0] + size; - if(needed >= begin[1]) { - void* ptr = xrealloc(begin, sizeof(unsigned int) * 2 + needed * 2); - begin = (unsigned int*) ptr; - begin[1] = needed * 2; - (*vec) = begin + 2; - } - - void* ptr = ((char*) (*vec)) + begin[0]; - begin[0] += size; - return ptr; -} - -#define vec_create(type, size) (type*) vec_do_create(sizeof(type), size * 2, size) -#define vec_create_reserve(type, size, capacity) (type*) vec_do_create(sizeof(type), capcity, size) -#define vec_init(array, size) array = vec_do_create(sizeof(*array), size * 2, size) -#define vec_init_reserve(array, size, capacity) *((void**) &array) = vec_do_create(sizeof(*array), capacity, size) -#define vec_free(vec) (free((vec) ? vec__raw(vec) : NULL), vec = NULL) -#define vec_erase_range(vec, pos, count) vec_do_erase(vec, pos * sizeof(*vec), count * sizeof(*vec)) -#define vec_erase(vec, pos) vec_do_erase(vec, pos * sizeof(*vec), sizeof(*vec)) -#define vec_size(vec) (vec__raw(vec)[0] / sizeof(*vec)) -#define vec_capacity(vec) (vec_raw(vec)[1] / sizeof(*vec)) -#define vec_add(vec) vec_do_add((void**) &vec, sizeof(*vec)) -#define vec_addc(vec, count) (vec_do_add((void**) &vec, sizeof(*vec) * count)) -#define vec_push(vec, value) (vec_do_add((void**) &vec, sizeof(*vec)), vec_last(vec) = (value)) -#define vec_pop(vec) (vec__raw(vec)[0] -= sizeof(*vec)) -#define vec_popc(vec, count) (vec__raw(vec)[0] -= sizeof(*vec) * count) -#define vec_clear(vec) (vec__raw(vec)[0] = 0) -#define vec_last(vec) (vec[vec_size(vec) - 1]) - -static struct dlg_data* dlg_create_data(void) { - struct dlg_data* data = (struct dlg_data*) xalloc(sizeof(struct dlg_data)); - vec_init_reserve(data->tags, 0, 20); - vec_init_reserve(data->pairs, 0, 20); - data->buffer_size = 100; - data->buffer = (char*) xalloc(data->buffer_size); - return data; -} - -static void dlg_free_data(void* ddata) { - struct dlg_data* data = (struct dlg_data*) ddata; - if(data) { - vec_free(data->pairs); - vec_free(data->tags); - free(data->buffer); - free(data); - } -} - -void dlg_add_tag(const char* tag, const char* func) { - struct dlg_data* data = dlg_data(); - struct dlg_tag_func_pair* pair = - (struct dlg_tag_func_pair*) vec_add(data->pairs); - pair->tag = tag; - pair->func = func; -} - -bool dlg_remove_tag(const char* tag, const char* func) { - struct dlg_data* data = dlg_data(); - for(unsigned int i = 0; i < vec_size(data->pairs); ++i) { - if(data->pairs[i].func == func && data->pairs[i].tag == tag) { - vec_erase(data->pairs, i); - return true; - } - } - - return false; -} - -char** dlg_thread_buffer(size_t** size) { - struct dlg_data* data = dlg_data(); - if(size) { - *size = &data->buffer_size; - } - return &data->buffer; -} - -void dlg_set_handler(dlg_handler handler, void* data) { - g_handler = handler; - g_data = data; -} - -dlg_handler dlg_get_handler(void** data) { - *data = g_data; - return g_handler; -} - -const char* dlg__printf_format(const char* str, ...) { - va_list vlist; - va_start(vlist, str); - - va_list vlistcopy; - va_copy(vlistcopy, vlist); - int needed = vsnprintf(NULL, 0, str, vlist); - if(needed < 0) { - printf("dlg__printf_format: invalid format given\n"); - va_end(vlist); - va_end(vlistcopy); - return NULL; - } - - va_end(vlist); - - size_t* buf_size; - char** buf = dlg_thread_buffer(&buf_size); - if(*buf_size <= (unsigned int) needed) { - *buf_size = (needed + 1) * 2; - *buf = (char*) xrealloc(*buf, *buf_size); - } - - vsnprintf(*buf, *buf_size, str, vlistcopy); - va_end(vlistcopy); - - return *buf; -} - -void dlg__do_log(enum dlg_level lvl, const char* const* tags, const char* file, int line, - const char* func, const char* string, const char* expr) { - struct dlg_data* data = dlg_data(); - unsigned int tag_count = 0; - - // push default tags - while(tags[tag_count]) { - vec_push(data->tags, tags[tag_count++]); - } - - // push current global tags - for(size_t i = 0; i < vec_size(data->pairs); ++i) { - const struct dlg_tag_func_pair pair = data->pairs[i]; - if(pair.func == NULL || !strcmp(pair.func, func)) { - vec_push(data->tags, pair.tag); - } - } - - // push call-specific tags, skip first terminating NULL - ++tag_count; - while(tags[tag_count]) { - vec_push(data->tags, tags[tag_count++]); - } - - vec_push(data->tags, NULL); // terminating NULL - struct dlg_origin origin; - origin.level = lvl; - origin.file = file; - origin.line = line; - origin.func = func; - origin.expr = expr; - origin.tags = data->tags; - - g_handler(&origin, string, g_data); - vec_clear(data->tags); -} - -#ifdef _MSC_VER -// shitty msvc compatbility -// meson gives us sane paths (separated by '/') while on MSVC, -// __FILE__ contains a '\\' separator. -static bool path_same(char a, char b) { - return (a == b) || - (a == '/' && b == '\\') || - (a == '\\' && b == '/'); -} -#else - -static inline bool path_same(char a, char b) { - return a == b; -} - -#endif - -const char* dlg__strip_root_path(const char* file, const char* base) { - if(!file) { - return NULL; - } - - const char* saved = file; - if(*file == '.') { // relative path detected - while(*(++file) == '.' || *file == '/' || *file == '\\'); - if(*file == '\0') { // weird case: purely relative path without file - return saved; - } - - return file; - } - - // strip base from file if it is given - if(base) { - char fn = *file; - char bn = *base; - while(bn != '\0' && path_same(fn, bn)) { - fn = *(++file); - bn = *(++base); - } - - if(fn == '\0' || bn != '\0') { // weird case: base isn't prefix of file - return saved; - } - } - - return file; -} diff --git a/vendor/freetype/src/dlg/dlgwrap.c b/vendor/freetype/src/dlg/dlgwrap.c index e9dc3410a4..e6053cd5bc 100644 --- a/vendor/freetype/src/dlg/dlgwrap.c +++ b/vendor/freetype/src/dlg/dlgwrap.c @@ -4,7 +4,7 @@ * * Wrapper file for the 'dlg' library (body only) * - * Copyright (C) 2020-2023 by + * Copyright (C) 2020-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/gxvalid/README b/vendor/freetype/src/gxvalid/README index 0e3db322ef..efd792c9a1 100644 --- a/vendor/freetype/src/gxvalid/README +++ b/vendor/freetype/src/gxvalid/README @@ -518,7 +518,7 @@ gxvalid: TrueType GX validator ------------------------------------------------------------------------ -Copyright (C) 2004-2023 by +Copyright (C) 2004-2024 by suzuki toshiya, Masatake YAMATO, Red hat K.K., David Turner, Robert Wilhelm, and Werner Lemberg. diff --git a/vendor/freetype/src/gxvalid/gxvalid.c b/vendor/freetype/src/gxvalid/gxvalid.c index e0359f4df7..6694c342c0 100644 --- a/vendor/freetype/src/gxvalid/gxvalid.c +++ b/vendor/freetype/src/gxvalid/gxvalid.c @@ -4,7 +4,7 @@ * * FreeType validator for TrueTypeGX/AAT tables (body only). * - * Copyright (C) 2005-2023 by + * Copyright (C) 2005-2024 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/vendor/freetype/src/gxvalid/gxvalid.h b/vendor/freetype/src/gxvalid/gxvalid.h index a83408b416..4ddb625e9e 100644 --- a/vendor/freetype/src/gxvalid/gxvalid.h +++ b/vendor/freetype/src/gxvalid/gxvalid.h @@ -4,7 +4,7 @@ * * TrueTypeGX/AAT table validation (specification only). * - * Copyright (C) 2005-2023 by + * Copyright (C) 2005-2024 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/vendor/freetype/src/gxvalid/gxvbsln.c b/vendor/freetype/src/gxvalid/gxvbsln.c index 030a64ee45..e3a922aebc 100644 --- a/vendor/freetype/src/gxvalid/gxvbsln.c +++ b/vendor/freetype/src/gxvalid/gxvbsln.c @@ -4,7 +4,7 @@ * * TrueTypeGX/AAT bsln table validation (body). * - * Copyright (C) 2004-2023 by + * Copyright (C) 2004-2024 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/vendor/freetype/src/gxvalid/gxvcommn.c b/vendor/freetype/src/gxvalid/gxvcommn.c index 7f908742af..5f8fa115f5 100644 --- a/vendor/freetype/src/gxvalid/gxvcommn.c +++ b/vendor/freetype/src/gxvalid/gxvcommn.c @@ -4,7 +4,7 @@ * * TrueTypeGX/AAT common tables validation (body). * - * Copyright (C) 2004-2023 by + * Copyright (C) 2004-2024 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/vendor/freetype/src/gxvalid/gxvcommn.h b/vendor/freetype/src/gxvalid/gxvcommn.h index f88d23a419..4dbac1db67 100644 --- a/vendor/freetype/src/gxvalid/gxvcommn.h +++ b/vendor/freetype/src/gxvalid/gxvcommn.h @@ -4,7 +4,7 @@ * * TrueTypeGX/AAT common tables validation (specification). * - * Copyright (C) 2004-2023 by + * Copyright (C) 2004-2024 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * @@ -516,9 +516,6 @@ FT_BEGIN_HEADER FT_INVALID_TOO_SHORT; \ FT_END_STMNT -#define GXV_USHORT_TO_SHORT( _us ) \ - ( ( 0x8000U < ( _us ) ) ? ( ( _us ) - 0x8000U ) : ( _us ) ) - #define GXV_STATETABLE_HEADER_SIZE ( 2 + 2 + 2 + 2 ) #define GXV_STATEHEADER_SIZE GXV_STATETABLE_HEADER_SIZE diff --git a/vendor/freetype/src/gxvalid/gxverror.h b/vendor/freetype/src/gxvalid/gxverror.h index 09311ed3c3..750f22fc3a 100644 --- a/vendor/freetype/src/gxvalid/gxverror.h +++ b/vendor/freetype/src/gxvalid/gxverror.h @@ -4,7 +4,7 @@ * * TrueTypeGX/AAT validation module error codes (specification only). * - * Copyright (C) 2004-2023 by + * Copyright (C) 2004-2024 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/vendor/freetype/src/gxvalid/gxvfeat.c b/vendor/freetype/src/gxvalid/gxvfeat.c index 6cf18212a3..57b389239b 100644 --- a/vendor/freetype/src/gxvalid/gxvfeat.c +++ b/vendor/freetype/src/gxvalid/gxvfeat.c @@ -4,7 +4,7 @@ * * TrueTypeGX/AAT feat table validation (body). * - * Copyright (C) 2004-2023 by + * Copyright (C) 2004-2024 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/vendor/freetype/src/gxvalid/gxvfeat.h b/vendor/freetype/src/gxvalid/gxvfeat.h index b33c1bc681..dd8f1bfe67 100644 --- a/vendor/freetype/src/gxvalid/gxvfeat.h +++ b/vendor/freetype/src/gxvalid/gxvfeat.h @@ -4,7 +4,7 @@ * * TrueTypeGX/AAT feat table validation (specification). * - * Copyright (C) 2004-2023 by + * Copyright (C) 2004-2024 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/vendor/freetype/src/gxvalid/gxvfgen.c b/vendor/freetype/src/gxvalid/gxvfgen.c index cf98bb36c3..27a4ed9a71 100644 --- a/vendor/freetype/src/gxvalid/gxvfgen.c +++ b/vendor/freetype/src/gxvalid/gxvfgen.c @@ -5,7 +5,7 @@ * Generate feature registry data for gxv `feat' validator. * This program is derived from gxfeatreg.c in gxlayout. * - * Copyright (C) 2004-2023 by + * Copyright (C) 2004-2024 by * Masatake YAMATO and Redhat K.K. * * This file may only be used, diff --git a/vendor/freetype/src/gxvalid/gxvjust.c b/vendor/freetype/src/gxvalid/gxvjust.c index 5cca94d8fd..1cf9e84ad4 100644 --- a/vendor/freetype/src/gxvalid/gxvjust.c +++ b/vendor/freetype/src/gxvalid/gxvjust.c @@ -4,7 +4,7 @@ * * TrueTypeGX/AAT just table validation (body). * - * Copyright (C) 2005-2023 by + * Copyright (C) 2005-2024 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/vendor/freetype/src/gxvalid/gxvkern.c b/vendor/freetype/src/gxvalid/gxvkern.c index 21fc24596c..cf8c51fb8e 100644 --- a/vendor/freetype/src/gxvalid/gxvkern.c +++ b/vendor/freetype/src/gxvalid/gxvkern.c @@ -4,7 +4,7 @@ * * TrueTypeGX/AAT kern table validation (body). * - * Copyright (C) 2004-2023 by + * Copyright (C) 2004-2024 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/vendor/freetype/src/gxvalid/gxvlcar.c b/vendor/freetype/src/gxvalid/gxvlcar.c index 5f3bf89073..0b310f42df 100644 --- a/vendor/freetype/src/gxvalid/gxvlcar.c +++ b/vendor/freetype/src/gxvalid/gxvlcar.c @@ -4,7 +4,7 @@ * * TrueTypeGX/AAT lcar table validation (body). * - * Copyright (C) 2004-2023 by + * Copyright (C) 2004-2024 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/vendor/freetype/src/gxvalid/gxvmod.c b/vendor/freetype/src/gxvalid/gxvmod.c index 0b4115bbc6..ce1e441eb4 100644 --- a/vendor/freetype/src/gxvalid/gxvmod.c +++ b/vendor/freetype/src/gxvalid/gxvmod.c @@ -4,7 +4,7 @@ * * FreeType's TrueTypeGX/AAT validation module implementation (body). * - * Copyright (C) 2004-2023 by + * Copyright (C) 2004-2024 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/vendor/freetype/src/gxvalid/gxvmod.h b/vendor/freetype/src/gxvalid/gxvmod.h index db3d1d9f56..6def5c5475 100644 --- a/vendor/freetype/src/gxvalid/gxvmod.h +++ b/vendor/freetype/src/gxvalid/gxvmod.h @@ -5,7 +5,7 @@ * FreeType's TrueTypeGX/AAT validation module implementation * (specification). * - * Copyright (C) 2004-2023 by + * Copyright (C) 2004-2024 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/vendor/freetype/src/gxvalid/gxvmort.c b/vendor/freetype/src/gxvalid/gxvmort.c index 7032d6349f..5ad9d81c59 100644 --- a/vendor/freetype/src/gxvalid/gxvmort.c +++ b/vendor/freetype/src/gxvalid/gxvmort.c @@ -4,7 +4,7 @@ * * TrueTypeGX/AAT mort table validation (body). * - * Copyright (C) 2005-2023 by + * Copyright (C) 2005-2024 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/vendor/freetype/src/gxvalid/gxvmort.h b/vendor/freetype/src/gxvalid/gxvmort.h index 5c819bdbc8..a3970e7862 100644 --- a/vendor/freetype/src/gxvalid/gxvmort.h +++ b/vendor/freetype/src/gxvalid/gxvmort.h @@ -4,7 +4,7 @@ * * TrueTypeGX/AAT common definition for mort table (specification). * - * Copyright (C) 2004-2023 by + * Copyright (C) 2004-2024 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/vendor/freetype/src/gxvalid/gxvmort0.c b/vendor/freetype/src/gxvalid/gxvmort0.c index 24e70a0dae..1a05a6d432 100644 --- a/vendor/freetype/src/gxvalid/gxvmort0.c +++ b/vendor/freetype/src/gxvalid/gxvmort0.c @@ -5,7 +5,7 @@ * TrueTypeGX/AAT mort table validation * body for type0 (Indic Script Rearrangement) subtable. * - * Copyright (C) 2005-2023 by + * Copyright (C) 2005-2024 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/vendor/freetype/src/gxvalid/gxvmort1.c b/vendor/freetype/src/gxvalid/gxvmort1.c index ea5591f980..f99a8a4987 100644 --- a/vendor/freetype/src/gxvalid/gxvmort1.c +++ b/vendor/freetype/src/gxvalid/gxvmort1.c @@ -5,7 +5,7 @@ * TrueTypeGX/AAT mort table validation * body for type1 (Contextual Substitution) subtable. * - * Copyright (C) 2005-2023 by + * Copyright (C) 2005-2024 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/vendor/freetype/src/gxvalid/gxvmort2.c b/vendor/freetype/src/gxvalid/gxvmort2.c index 50644f06a6..18c9be6760 100644 --- a/vendor/freetype/src/gxvalid/gxvmort2.c +++ b/vendor/freetype/src/gxvalid/gxvmort2.c @@ -5,7 +5,7 @@ * TrueTypeGX/AAT mort table validation * body for type2 (Ligature Substitution) subtable. * - * Copyright (C) 2005-2023 by + * Copyright (C) 2005-2024 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/vendor/freetype/src/gxvalid/gxvmort4.c b/vendor/freetype/src/gxvalid/gxvmort4.c index 0641b11330..bc190fadd1 100644 --- a/vendor/freetype/src/gxvalid/gxvmort4.c +++ b/vendor/freetype/src/gxvalid/gxvmort4.c @@ -5,7 +5,7 @@ * TrueTypeGX/AAT mort table validation * body for type4 (Non-Contextual Glyph Substitution) subtable. * - * Copyright (C) 2005-2023 by + * Copyright (C) 2005-2024 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/vendor/freetype/src/gxvalid/gxvmort5.c b/vendor/freetype/src/gxvalid/gxvmort5.c index 9225bb0c68..8211a294ad 100644 --- a/vendor/freetype/src/gxvalid/gxvmort5.c +++ b/vendor/freetype/src/gxvalid/gxvmort5.c @@ -5,7 +5,7 @@ * TrueTypeGX/AAT mort table validation * body for type5 (Contextual Glyph Insertion) subtable. * - * Copyright (C) 2005-2023 by + * Copyright (C) 2005-2024 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/vendor/freetype/src/gxvalid/gxvmorx.c b/vendor/freetype/src/gxvalid/gxvmorx.c index 931bf006b8..4e7a0d40aa 100644 --- a/vendor/freetype/src/gxvalid/gxvmorx.c +++ b/vendor/freetype/src/gxvalid/gxvmorx.c @@ -4,7 +4,7 @@ * * TrueTypeGX/AAT morx table validation (body). * - * Copyright (C) 2005-2023 by + * Copyright (C) 2005-2024 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/vendor/freetype/src/gxvalid/gxvmorx.h b/vendor/freetype/src/gxvalid/gxvmorx.h index 27572553dc..7e20b5f96b 100644 --- a/vendor/freetype/src/gxvalid/gxvmorx.h +++ b/vendor/freetype/src/gxvalid/gxvmorx.h @@ -4,7 +4,7 @@ * * TrueTypeGX/AAT common definition for morx table (specification). * - * Copyright (C) 2005-2023 by + * Copyright (C) 2005-2024 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/vendor/freetype/src/gxvalid/gxvmorx0.c b/vendor/freetype/src/gxvalid/gxvmorx0.c index 73523f3634..bff850bac5 100644 --- a/vendor/freetype/src/gxvalid/gxvmorx0.c +++ b/vendor/freetype/src/gxvalid/gxvmorx0.c @@ -5,7 +5,7 @@ * TrueTypeGX/AAT morx table validation * body for type0 (Indic Script Rearrangement) subtable. * - * Copyright (C) 2005-2023 by + * Copyright (C) 2005-2024 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/vendor/freetype/src/gxvalid/gxvmorx1.c b/vendor/freetype/src/gxvalid/gxvmorx1.c index 71a2018802..d8ded3bc4f 100644 --- a/vendor/freetype/src/gxvalid/gxvmorx1.c +++ b/vendor/freetype/src/gxvalid/gxvmorx1.c @@ -5,7 +5,7 @@ * TrueTypeGX/AAT morx table validation * body for type1 (Contextual Substitution) subtable. * - * Copyright (C) 2005-2023 by + * Copyright (C) 2005-2024 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/vendor/freetype/src/gxvalid/gxvmorx2.c b/vendor/freetype/src/gxvalid/gxvmorx2.c index 858c81143b..faa09e9025 100644 --- a/vendor/freetype/src/gxvalid/gxvmorx2.c +++ b/vendor/freetype/src/gxvalid/gxvmorx2.c @@ -5,7 +5,7 @@ * TrueTypeGX/AAT morx table validation * body for type2 (Ligature Substitution) subtable. * - * Copyright (C) 2005-2023 by + * Copyright (C) 2005-2024 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/vendor/freetype/src/gxvalid/gxvmorx4.c b/vendor/freetype/src/gxvalid/gxvmorx4.c index c9ad199060..40468b8491 100644 --- a/vendor/freetype/src/gxvalid/gxvmorx4.c +++ b/vendor/freetype/src/gxvalid/gxvmorx4.c @@ -5,7 +5,7 @@ * TrueTypeGX/AAT morx table validation * body for "morx" type4 (Non-Contextual Glyph Substitution) subtable. * - * Copyright (C) 2005-2023 by + * Copyright (C) 2005-2024 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/vendor/freetype/src/gxvalid/gxvmorx5.c b/vendor/freetype/src/gxvalid/gxvmorx5.c index 95fa4e288c..a3dbdd43d6 100644 --- a/vendor/freetype/src/gxvalid/gxvmorx5.c +++ b/vendor/freetype/src/gxvalid/gxvmorx5.c @@ -5,7 +5,7 @@ * TrueTypeGX/AAT morx table validation * body for type5 (Contextual Glyph Insertion) subtable. * - * Copyright (C) 2005-2023 by + * Copyright (C) 2005-2024 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/vendor/freetype/src/gxvalid/gxvopbd.c b/vendor/freetype/src/gxvalid/gxvopbd.c index 5e9a9665eb..98b5bb875a 100644 --- a/vendor/freetype/src/gxvalid/gxvopbd.c +++ b/vendor/freetype/src/gxvalid/gxvopbd.c @@ -4,7 +4,7 @@ * * TrueTypeGX/AAT opbd table validation (body). * - * Copyright (C) 2004-2023 by + * Copyright (C) 2004-2024 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/vendor/freetype/src/gxvalid/gxvprop.c b/vendor/freetype/src/gxvalid/gxvprop.c index 63a052a8e8..e485fa665a 100644 --- a/vendor/freetype/src/gxvalid/gxvprop.c +++ b/vendor/freetype/src/gxvalid/gxvprop.c @@ -4,7 +4,7 @@ * * TrueTypeGX/AAT prop table validation (body). * - * Copyright (C) 2004-2023 by + * Copyright (C) 2004-2024 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/vendor/freetype/src/gxvalid/gxvtrak.c b/vendor/freetype/src/gxvalid/gxvtrak.c index f3fb51c8ad..a402823af7 100644 --- a/vendor/freetype/src/gxvalid/gxvtrak.c +++ b/vendor/freetype/src/gxvalid/gxvtrak.c @@ -4,7 +4,7 @@ * * TrueTypeGX/AAT trak table validation (body). * - * Copyright (C) 2004-2023 by + * Copyright (C) 2004-2024 by * suzuki toshiya, Masatake YAMATO, Red Hat K.K., * David Turner, Robert Wilhelm, and Werner Lemberg. * diff --git a/vendor/freetype/src/gzip/README.freetype b/vendor/freetype/src/gzip/README.freetype index 76298b06b5..29304308fd 100644 --- a/vendor/freetype/src/gzip/README.freetype +++ b/vendor/freetype/src/gzip/README.freetype @@ -1,7 +1,7 @@ Name: zlib Short Name: zlib URL: http://zlib.net/ -Version: 1.2.13 +Version: 1.3 License: see `zlib.h` Description: @@ -19,5 +19,4 @@ The files in this directory have been prepared as follows. - Take the unmodified source code files from the zlib distribution that are included by `ftgzip.c`. - Copy `zconf.h` to `ftzconf.h` (which stays unmodified otherwise). - - Run zlib's `zlib2ansi` script on all `.c` files. - Apply the diff file(s) in the `patches` folder. diff --git a/vendor/freetype/src/gzip/adler32.c b/vendor/freetype/src/gzip/adler32.c index aa032e1ddf..260185b672 100644 --- a/vendor/freetype/src/gzip/adler32.c +++ b/vendor/freetype/src/gzip/adler32.c @@ -7,10 +7,6 @@ #include "zutil.h" -#ifndef Z_FREETYPE -local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2)); -#endif - #define BASE 65521U /* largest prime smaller than 65536 */ #define NMAX 5552 /* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */ @@ -62,11 +58,7 @@ local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2)); #endif /* ========================================================================= */ -uLong ZEXPORT adler32_z( - uLong adler, - const Bytef *buf, - z_size_t len) -{ +uLong ZEXPORT adler32_z(uLong adler, const Bytef *buf, z_size_t len) { unsigned long sum2; unsigned n; @@ -133,22 +125,14 @@ uLong ZEXPORT adler32_z( } /* ========================================================================= */ -uLong ZEXPORT adler32( - uLong adler, - const Bytef *buf, - uInt len) -{ +uLong ZEXPORT adler32(uLong adler, const Bytef *buf, uInt len) { return adler32_z(adler, buf, len); } #ifndef Z_FREETYPE /* ========================================================================= */ -local uLong adler32_combine_( - uLong adler1, - uLong adler2, - z_off64_t len2) -{ +local uLong adler32_combine_(uLong adler1, uLong adler2, z_off64_t len2) { unsigned long sum1; unsigned long sum2; unsigned rem; @@ -173,19 +157,11 @@ local uLong adler32_combine_( } /* ========================================================================= */ -uLong ZEXPORT adler32_combine( - uLong adler1, - uLong adler2, - z_off_t len2) -{ +uLong ZEXPORT adler32_combine(uLong adler1, uLong adler2, z_off_t len2) { return adler32_combine_(adler1, adler2, len2); } -uLong ZEXPORT adler32_combine64( - uLong adler1, - uLong adler2, - z_off64_t len2) -{ +uLong ZEXPORT adler32_combine64(uLong adler1, uLong adler2, z_off64_t len2) { return adler32_combine_(adler1, adler2, len2); } diff --git a/vendor/freetype/src/gzip/crc32.c b/vendor/freetype/src/gzip/crc32.c index 6cd1b09d56..27487dcc25 100644 --- a/vendor/freetype/src/gzip/crc32.c +++ b/vendor/freetype/src/gzip/crc32.c @@ -103,21 +103,6 @@ # define ARMCRC32 #endif -#ifndef Z_FREETYPE -/* Local functions. */ -local z_crc_t multmodp OF((z_crc_t a, z_crc_t b)); -local z_crc_t x2nmodp OF((z_off64_t n, unsigned k)); -#endif /* Z_FREETYPE */ - -#if defined(W) && (!defined(ARMCRC32) || defined(DYNAMIC_CRC_TABLE)) - local z_word_t byte_swap OF((z_word_t word)); -#endif - -#if defined(W) && !defined(ARMCRC32) - local z_crc_t crc_word OF((z_word_t data)); - local z_word_t crc_word_big OF((z_word_t data)); -#endif - #if defined(W) && (!defined(ARMCRC32) || defined(DYNAMIC_CRC_TABLE)) /* Swap the bytes in a z_word_t to convert between little and big endian. Any @@ -125,9 +110,7 @@ local z_crc_t x2nmodp OF((z_off64_t n, unsigned k)); instruction, if one is available. This assumes that word_t is either 32 bits or 64 bits. */ -local z_word_t byte_swap( - z_word_t word) -{ +local z_word_t byte_swap(z_word_t word) { # if W == 8 return (word & 0xff00000000000000) >> 56 | @@ -148,24 +131,81 @@ local z_word_t byte_swap( } #endif +#ifdef DYNAMIC_CRC_TABLE +/* ========================================================================= + * Table of powers of x for combining CRC-32s, filled in by make_crc_table() + * below. + */ + local z_crc_t FAR x2n_table[32]; +#else +/* ========================================================================= + * Tables for byte-wise and braided CRC-32 calculations, and a table of powers + * of x for combining CRC-32s, all made by make_crc_table(). + */ +# include "crc32.h" +#endif + /* CRC polynomial. */ #define POLY 0xedb88320 /* p(x) reflected, with x^32 implied */ -#ifdef DYNAMIC_CRC_TABLE +#ifndef Z_FREETYPE +/* + Return a(x) multiplied by b(x) modulo p(x), where p(x) is the CRC polynomial, + reflected. For speed, this requires that a not be zero. + */ +local z_crc_t multmodp(z_crc_t a, z_crc_t b) { + z_crc_t m, p; + + m = (z_crc_t)1 << 31; + p = 0; + for (;;) { + if (a & m) { + p ^= b; + if ((a & (m - 1)) == 0) + break; + } + m >>= 1; + b = b & 1 ? (b >> 1) ^ POLY : b >> 1; + } + return p; +} + +/* + Return x^(n * 2^k) modulo p(x). Requires that x2n_table[] has been + initialized. + */ +local z_crc_t x2nmodp(z_off64_t n, unsigned k) { + z_crc_t p; + + p = (z_crc_t)1 << 31; /* x^0 == 1 */ + while (n) { + if (n & 1) + p = multmodp(x2n_table[k & 31], p); + n >>= 1; + k++; + } + return p; +} + +#endif /* !Z_FREETYPE */ + +#ifdef DYNAMIC_CRC_TABLE +/* ========================================================================= + * Build the tables for byte-wise and braided CRC-32 calculations, and a table + * of powers of x for combining CRC-32s. + */ local z_crc_t FAR crc_table[256]; -local z_crc_t FAR x2n_table[32]; -local void make_crc_table OF((void)); #ifdef W local z_word_t FAR crc_big_table[256]; local z_crc_t FAR crc_braid_table[W][256]; local z_word_t FAR crc_braid_big_table[W][256]; - local void braid OF((z_crc_t [][256], z_word_t [][256], int, int)); + local void braid(z_crc_t [][256], z_word_t [][256], int, int); #endif #ifdef MAKECRCH - local void write_table OF((FILE *, const z_crc_t FAR *, int)); - local void write_table32hi OF((FILE *, const z_word_t FAR *, int)); - local void write_table64 OF((FILE *, const z_word_t FAR *, int)); + local void write_table(FILE *, const z_crc_t FAR *, int); + local void write_table32hi(FILE *, const z_word_t FAR *, int); + local void write_table64(FILE *, const z_word_t FAR *, int); #endif /* MAKECRCH */ /* @@ -178,7 +218,6 @@ local void make_crc_table OF((void)); /* Definition of once functionality. */ typedef struct once_s once_t; -local void once OF((once_t *, void (*)(void))); /* Check for the availability of atomics. */ #if defined(__STDC__) && __STDC_VERSION__ >= 201112L && \ @@ -198,10 +237,7 @@ struct once_s { invoke once() at the same time. The state must be a once_t initialized with ONCE_INIT. */ -local void once(state, init) - once_t *state; - void (*init)(void); -{ +local void once(once_t *state, void (*init)(void)) { if (!atomic_load(&state->done)) { if (atomic_flag_test_and_set(&state->begun)) while (!atomic_load(&state->done)) @@ -224,10 +260,7 @@ struct once_s { /* Test and set. Alas, not atomic, but tries to minimize the period of vulnerability. */ -local int test_and_set OF((int volatile *)); -local int test_and_set( - int volatile *flag) -{ +local int test_and_set(int volatile *flag) { int was; was = *flag; @@ -236,10 +269,7 @@ local int test_and_set( } /* Run the provided init() function once. This is not thread-safe. */ -local void once(state, init) - once_t *state; - void (*init)(void); -{ +local void once(once_t *state, void (*init)(void)) { if (!state->done) { if (test_and_set(&state->begun)) while (!state->done) @@ -281,8 +311,7 @@ local once_t made = ONCE_INIT; combinations of CRC register values and incoming bytes. */ -local void make_crc_table() -{ +local void make_crc_table(void) { unsigned i, j, n; z_crc_t p; @@ -449,11 +478,7 @@ local void make_crc_table() Write the 32-bit values in table[0..k-1] to out, five per line in hexadecimal separated by commas. */ -local void write_table( - FILE *out, - const z_crc_t FAR *table, - int k) -{ +local void write_table(FILE *out, const z_crc_t FAR *table, int k) { int n; for (n = 0; n < k; n++) @@ -466,11 +491,7 @@ local void write_table( Write the high 32-bits of each value in table[0..k-1] to out, five per line in hexadecimal separated by commas. */ -local void write_table32hi( - FILE *out, - const z_word_t FAR *table, - int k) -{ +local void write_table32hi(FILE *out, const z_word_t FAR *table, int k) { int n; for (n = 0; n < k; n++) @@ -486,11 +507,7 @@ local void write_table32hi( bits. If not, then the type cast and format string can be adjusted accordingly. */ -local void write_table64( - FILE *out, - const z_word_t FAR *table, - int k) -{ +local void write_table64(FILE *out, const z_word_t FAR *table, int k) { int n; for (n = 0; n < k; n++) @@ -500,8 +517,7 @@ local void write_table64( } /* Actually do the deed. */ -int main() -{ +int main(void) { make_crc_table(); return 0; } @@ -513,12 +529,7 @@ int main() Generate the little and big-endian braid tables for the given n and z_word_t size w. Each array must have room for w blocks of 256 elements. */ -local void braid(ltl, big, n, w) - z_crc_t ltl[][256]; - z_word_t big[][256]; - int n; - int w; -{ +local void braid(z_crc_t ltl[][256], z_word_t big[][256], int n, int w) { int k; z_crc_t i, p, q; for (k = 0; k < w; k++) { @@ -533,78 +544,22 @@ local void braid(ltl, big, n, w) } #endif -#else /* !DYNAMIC_CRC_TABLE */ -/* ======================================================================== - * Tables for byte-wise and braided CRC-32 calculations, and a table of powers - * of x for combining CRC-32s, all made by make_crc_table(). - */ -#include "crc32.h" #endif /* DYNAMIC_CRC_TABLE */ -/* ======================================================================== - * Routines used for CRC calculation. Some are also required for the table - * generation above. - */ - #ifndef Z_FREETYPE -/* - Return a(x) multiplied by b(x) modulo p(x), where p(x) is the CRC polynomial, - reflected. For speed, this requires that a not be zero. - */ -local z_crc_t multmodp( - z_crc_t a, - z_crc_t b) -{ - z_crc_t m, p; - - m = (z_crc_t)1 << 31; - p = 0; - for (;;) { - if (a & m) { - p ^= b; - if ((a & (m - 1)) == 0) - break; - } - m >>= 1; - b = b & 1 ? (b >> 1) ^ POLY : b >> 1; - } - return p; -} - -/* - Return x^(n * 2^k) modulo p(x). Requires that x2n_table[] has been - initialized. - */ -local z_crc_t x2nmodp( - z_off64_t n, - unsigned k) -{ - z_crc_t p; - - p = (z_crc_t)1 << 31; /* x^0 == 1 */ - while (n) { - if (n & 1) - p = multmodp(x2n_table[k & 31], p); - n >>= 1; - k++; - } - return p; -} - /* ========================================================================= * This function can be used by asm versions of crc32(), and to force the * generation of the CRC tables in a threaded application. */ -const z_crc_t FAR * ZEXPORT get_crc_table() -{ +const z_crc_t FAR * ZEXPORT get_crc_table(void) { #ifdef DYNAMIC_CRC_TABLE once(&made, make_crc_table); #endif /* DYNAMIC_CRC_TABLE */ return (const z_crc_t FAR *)crc_table; } -#endif /* Z_FREETYPE */ +#endif /* !Z_FREETYPE */ /* ========================================================================= * Use ARM machine instructions if available. This will compute the CRC about @@ -625,11 +580,8 @@ const z_crc_t FAR * ZEXPORT get_crc_table() #define Z_BATCH_ZEROS 0xa10d3d0c /* computed from Z_BATCH = 3990 */ #define Z_BATCH_MIN 800 /* fewest words in a final batch */ -unsigned long ZEXPORT crc32_z( - unsigned long crc, - const unsigned char FAR *buf, - z_size_t len) -{ +unsigned long ZEXPORT crc32_z(unsigned long crc, const unsigned char FAR *buf, + z_size_t len) { z_crc_t val; z_word_t crc1, crc2; const z_word_t *word; @@ -729,18 +681,14 @@ unsigned long ZEXPORT crc32_z( least-significant byte of the word as the first byte of data, without any pre or post conditioning. This is used to combine the CRCs of each braid. */ -local z_crc_t crc_word( - z_word_t data) -{ +local z_crc_t crc_word(z_word_t data) { int k; for (k = 0; k < W; k++) data = (data >> 8) ^ crc_table[data & 0xff]; return (z_crc_t)data; } -local z_word_t crc_word_big( - z_word_t data) -{ +local z_word_t crc_word_big(z_word_t data) { int k; for (k = 0; k < W; k++) data = (data << 8) ^ @@ -751,11 +699,8 @@ local z_word_t crc_word_big( #endif /* ========================================================================= */ -unsigned long ZEXPORT crc32_z( - unsigned long crc, - const unsigned char FAR *buf, - z_size_t len) -{ +unsigned long ZEXPORT crc32_z(unsigned long crc, const unsigned char FAR *buf, + z_size_t len) { /* Return initial CRC, if requested. */ if (buf == Z_NULL) return 0; @@ -787,8 +732,8 @@ unsigned long ZEXPORT crc32_z( words = (z_word_t const *)buf; /* Do endian check at execution time instead of compile time, since ARM - processors can change the endianess at execution time. If the - compiler knows what the endianess will be, it can optimize out the + processors can change the endianness at execution time. If the + compiler knows what the endianness will be, it can optimize out the check and the unused branch. */ endian = 1; if (*(unsigned char *)&endian) { @@ -1075,22 +1020,15 @@ unsigned long ZEXPORT crc32_z( #endif /* ========================================================================= */ -unsigned long ZEXPORT crc32( - unsigned long crc, - const unsigned char FAR *buf, - uInt len) -{ +unsigned long ZEXPORT crc32(unsigned long crc, const unsigned char FAR *buf, + uInt len) { return crc32_z(crc, buf, len); } #ifndef Z_FREETYPE /* ========================================================================= */ -uLong ZEXPORT crc32_combine64( - uLong crc1, - uLong crc2, - z_off64_t len2) -{ +uLong ZEXPORT crc32_combine64(uLong crc1, uLong crc2, z_off64_t len2) { #ifdef DYNAMIC_CRC_TABLE once(&made, make_crc_table); #endif /* DYNAMIC_CRC_TABLE */ @@ -1098,18 +1036,12 @@ uLong ZEXPORT crc32_combine64( } /* ========================================================================= */ -uLong ZEXPORT crc32_combine( - uLong crc1, - uLong crc2, - z_off_t len2) -{ +uLong ZEXPORT crc32_combine(uLong crc1, uLong crc2, z_off_t len2) { return crc32_combine64(crc1, crc2, (z_off64_t)len2); } /* ========================================================================= */ -uLong ZEXPORT crc32_combine_gen64( - z_off64_t len2) -{ +uLong ZEXPORT crc32_combine_gen64(z_off64_t len2) { #ifdef DYNAMIC_CRC_TABLE once(&made, make_crc_table); #endif /* DYNAMIC_CRC_TABLE */ @@ -1117,19 +1049,13 @@ uLong ZEXPORT crc32_combine_gen64( } /* ========================================================================= */ -uLong ZEXPORT crc32_combine_gen( - z_off_t len2) -{ +uLong ZEXPORT crc32_combine_gen(z_off_t len2) { return crc32_combine_gen64((z_off64_t)len2); } /* ========================================================================= */ -uLong ZEXPORT crc32_combine_op( - uLong crc1, - uLong crc2, - uLong op) -{ +uLong ZEXPORT crc32_combine_op(uLong crc1, uLong crc2, uLong op) { return multmodp(op, crc1) ^ (crc2 & 0xffffffff); } -#endif /* Z_FREETYPE */ +#endif /* !Z_FREETYPE */ diff --git a/vendor/freetype/src/gzip/ftgzip.c b/vendor/freetype/src/gzip/ftgzip.c index ca6a2aabe6..f77377ef9a 100644 --- a/vendor/freetype/src/gzip/ftgzip.c +++ b/vendor/freetype/src/gzip/ftgzip.c @@ -8,7 +8,7 @@ * parse compressed PCF fonts, as found with many X11 server * distributions. * - * Copyright (C) 2002-2023 by + * Copyright (C) 2002-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/gzip/ftzconf.h b/vendor/freetype/src/gzip/ftzconf.h index bf977d3e70..fb76ffe312 100644 --- a/vendor/freetype/src/gzip/ftzconf.h +++ b/vendor/freetype/src/gzip/ftzconf.h @@ -241,7 +241,11 @@ #endif #ifdef Z_SOLO - typedef unsigned long z_size_t; +# ifdef _WIN64 + typedef unsigned long long z_size_t; +# else + typedef unsigned long z_size_t; +# endif #else # define z_longlong long long # if defined(NO_SIZE_T) @@ -520,7 +524,7 @@ typedef uLong FAR uLongf; #if !defined(_WIN32) && defined(Z_LARGE64) # define z_off64_t off64_t #else -# if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO) +# if defined(_WIN32) && !defined(__GNUC__) # define z_off64_t __int64 # else # define z_off64_t z_off_t diff --git a/vendor/freetype/src/gzip/gzguts.h b/vendor/freetype/src/gzip/gzguts.h index 4f09a52a7a..f9a250b856 100644 --- a/vendor/freetype/src/gzip/gzguts.h +++ b/vendor/freetype/src/gzip/gzguts.h @@ -7,9 +7,8 @@ # ifndef _LARGEFILE_SOURCE # define _LARGEFILE_SOURCE 1 # endif -# ifdef _FILE_OFFSET_BITS -# undef _FILE_OFFSET_BITS -# endif +# undef _FILE_OFFSET_BITS +# undef _TIME_BITS #endif #ifdef HAVE_HIDDEN @@ -119,8 +118,8 @@ /* gz* functions always use library allocation functions */ #ifndef STDC - extern voidp malloc OF((uInt size)); - extern void free OF((voidpf ptr)); + extern voidp malloc(uInt size); + extern void free(voidpf ptr); #endif /* get errno and strerror definition */ @@ -138,10 +137,10 @@ /* provide prototypes for these when building zlib without LFS */ #if !defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0 - ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); - ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int)); - ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile)); - ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile)); + ZEXTERN gzFile ZEXPORT gzopen64(const char *, const char *); + ZEXTERN z_off64_t ZEXPORT gzseek64(gzFile, z_off64_t, int); + ZEXTERN z_off64_t ZEXPORT gztell64(gzFile); + ZEXTERN z_off64_t ZEXPORT gzoffset64(gzFile); #endif /* default memLevel */ @@ -203,9 +202,9 @@ typedef struct { typedef gz_state FAR *gz_statep; /* shared functions */ -void ZLIB_INTERNAL gz_error OF((gz_statep, int, const char *)); +void ZLIB_INTERNAL gz_error(gz_statep, int, const char *); #if defined UNDER_CE -char ZLIB_INTERNAL *gz_strwinerror OF((DWORD error)); +char ZLIB_INTERNAL *gz_strwinerror(DWORD error); #endif /* GT_OFF(x), where x is an unsigned value, is true if x > maximum z_off64_t @@ -214,6 +213,6 @@ char ZLIB_INTERNAL *gz_strwinerror OF((DWORD error)); #ifdef INT_MAX # define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > INT_MAX) #else -unsigned ZLIB_INTERNAL gz_intmax OF((void)); +unsigned ZLIB_INTERNAL gz_intmax(void); # define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > gz_intmax()) #endif diff --git a/vendor/freetype/src/gzip/inffast.c b/vendor/freetype/src/gzip/inffast.c index 809737b13c..9354676e78 100644 --- a/vendor/freetype/src/gzip/inffast.c +++ b/vendor/freetype/src/gzip/inffast.c @@ -47,10 +47,7 @@ requires strm->avail_out >= 258 for each loop to avoid checking for output space. */ -void ZLIB_INTERNAL inflate_fast( - z_streamp strm, - unsigned start) -{ +void ZLIB_INTERNAL inflate_fast(z_streamp strm, unsigned start) { struct inflate_state FAR *state; z_const unsigned char FAR *in; /* local strm->next_in */ z_const unsigned char FAR *last; /* have enough input while in < last */ diff --git a/vendor/freetype/src/gzip/inffast.h b/vendor/freetype/src/gzip/inffast.h index 684ae878c1..a38c5be450 100644 --- a/vendor/freetype/src/gzip/inffast.h +++ b/vendor/freetype/src/gzip/inffast.h @@ -8,4 +8,4 @@ subject to change. Applications should only use zlib.h. */ -static void ZLIB_INTERNAL inflate_fast OF((z_streamp strm, unsigned start)); +static void ZLIB_INTERNAL inflate_fast(z_streamp strm, unsigned start); diff --git a/vendor/freetype/src/gzip/inflate.c b/vendor/freetype/src/gzip/inflate.c index 5117e2e26a..f7ed5d1813 100644 --- a/vendor/freetype/src/gzip/inflate.c +++ b/vendor/freetype/src/gzip/inflate.c @@ -91,22 +91,7 @@ # endif #endif -/* function prototypes */ -local int inflateStateCheck OF((z_streamp strm)); -local void fixedtables OF((struct inflate_state FAR *state)); -local int updatewindow OF((z_streamp strm, const unsigned char FAR *end, - unsigned copy)); -#ifdef BUILDFIXED - void makefixed OF((void)); -#endif -#ifndef Z_FREETYPE -local unsigned syncsearch OF((unsigned FAR *have, const unsigned char FAR *buf, - unsigned len)); -#endif - -local int inflateStateCheck( - z_streamp strm) -{ +local int inflateStateCheck(z_streamp strm) { struct inflate_state FAR *state; if (strm == Z_NULL || strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0) @@ -118,9 +103,7 @@ local int inflateStateCheck( return 0; } -int ZEXPORT inflateResetKeep( - z_streamp strm) -{ +int ZEXPORT inflateResetKeep(z_streamp strm) { struct inflate_state FAR *state; if (inflateStateCheck(strm)) return Z_STREAM_ERROR; @@ -144,9 +127,7 @@ int ZEXPORT inflateResetKeep( return Z_OK; } -int ZEXPORT inflateReset( - z_streamp strm) -{ +int ZEXPORT inflateReset(z_streamp strm) { struct inflate_state FAR *state; if (inflateStateCheck(strm)) return Z_STREAM_ERROR; @@ -157,10 +138,7 @@ int ZEXPORT inflateReset( return inflateResetKeep(strm); } -int ZEXPORT inflateReset2( - z_streamp strm, - int windowBits) -{ +int ZEXPORT inflateReset2(z_streamp strm, int windowBits) { int wrap; struct inflate_state FAR *state; @@ -197,12 +175,8 @@ int ZEXPORT inflateReset2( return inflateReset(strm); } -int ZEXPORT inflateInit2_( - z_streamp strm, - int windowBits, - const char *version, - int stream_size) -{ +int ZEXPORT inflateInit2_(z_streamp strm, int windowBits, + const char *version, int stream_size) { int ret; struct inflate_state FAR *state; @@ -243,22 +217,17 @@ int ZEXPORT inflateInit2_( #ifndef Z_FREETYPE -int ZEXPORT inflateInit_( - z_streamp strm, - const char *version, - int stream_size) -{ +int ZEXPORT inflateInit_(z_streamp strm, const char *version, + int stream_size) { return inflateInit2_(strm, DEF_WBITS, version, stream_size); } -int ZEXPORT inflatePrime( - z_streamp strm, - int bits, - int value) -{ +int ZEXPORT inflatePrime(z_streamp strm, int bits, int value) { struct inflate_state FAR *state; if (inflateStateCheck(strm)) return Z_STREAM_ERROR; + if (bits == 0) + return Z_OK; state = (struct inflate_state FAR *)strm->state; if (bits < 0) { state->hold = 0; @@ -284,9 +253,7 @@ int ZEXPORT inflatePrime( used for threaded applications, since the rewriting of the tables and virgin may not be thread-safe. */ -local void fixedtables( - struct inflate_state FAR *state) -{ +local void fixedtables(struct inflate_state FAR *state) { #ifdef BUILDFIXED static int virgin = 1; static code *lenfix, *distfix; @@ -348,7 +315,7 @@ local void fixedtables( a.out > inffixed.h */ -void makefixed() +void makefixed(void) { unsigned low, size; struct inflate_state state; @@ -402,11 +369,7 @@ void makefixed() output will fall in the output data, making match copies simpler and faster. The advantage may be dependent on the size of the processor's data caches. */ -local int updatewindow( - z_streamp strm, - const Bytef *end, - unsigned copy) -{ +local int updatewindow(z_streamp strm, const Bytef *end, unsigned copy) { struct inflate_state FAR *state; unsigned dist; @@ -628,10 +591,7 @@ local int updatewindow( will return Z_BUF_ERROR if it has not reached the end of the stream. */ -int ZEXPORT inflate( - z_streamp strm, - int flush) -{ +int ZEXPORT inflate(z_streamp strm, int flush) { struct inflate_state FAR *state; z_const unsigned char FAR *next; /* next input */ unsigned char FAR *put; /* next output */ @@ -1307,9 +1267,7 @@ int ZEXPORT inflate( return ret; } -int ZEXPORT inflateEnd( - z_streamp strm) -{ +int ZEXPORT inflateEnd(z_streamp strm) { struct inflate_state FAR *state; if (inflateStateCheck(strm)) return Z_STREAM_ERROR; @@ -1323,11 +1281,8 @@ int ZEXPORT inflateEnd( #ifndef Z_FREETYPE -int ZEXPORT inflateGetDictionary( - z_streamp strm, - Bytef *dictionary, - uInt *dictLength) -{ +int ZEXPORT inflateGetDictionary(z_streamp strm, Bytef *dictionary, + uInt *dictLength) { struct inflate_state FAR *state; /* check state */ @@ -1346,11 +1301,8 @@ int ZEXPORT inflateGetDictionary( return Z_OK; } -int ZEXPORT inflateSetDictionary( - z_streamp strm, - const Bytef *dictionary, - uInt dictLength) -{ +int ZEXPORT inflateSetDictionary(z_streamp strm, const Bytef *dictionary, + uInt dictLength) { struct inflate_state FAR *state; unsigned long dictid; int ret; @@ -1381,10 +1333,7 @@ int ZEXPORT inflateSetDictionary( return Z_OK; } -int ZEXPORT inflateGetHeader( - z_streamp strm, - gz_headerp head) -{ +int ZEXPORT inflateGetHeader(z_streamp strm, gz_headerp head) { struct inflate_state FAR *state; /* check state */ @@ -1409,11 +1358,8 @@ int ZEXPORT inflateGetHeader( called again with more data and the *have state. *have is initialized to zero for the first call. */ -local unsigned syncsearch( - unsigned FAR *have, - const unsigned char FAR *buf, - unsigned len) -{ +local unsigned syncsearch(unsigned FAR *have, const unsigned char FAR *buf, + unsigned len) { unsigned got; unsigned next; @@ -1432,9 +1378,7 @@ local unsigned syncsearch( return next; } -int ZEXPORT inflateSync( - z_streamp strm) -{ +int ZEXPORT inflateSync(z_streamp strm) { unsigned len; /* number of bytes to look at or looked at */ int flags; /* temporary to save header status */ unsigned long in, out; /* temporary to save total_in and total_out */ @@ -1490,9 +1434,7 @@ int ZEXPORT inflateSync( block. When decompressing, PPP checks that at the end of input packet, inflate is waiting for these length bytes. */ -int ZEXPORT inflateSyncPoint( - z_streamp strm) -{ +int ZEXPORT inflateSyncPoint(z_streamp strm) { struct inflate_state FAR *state; if (inflateStateCheck(strm)) return Z_STREAM_ERROR; @@ -1500,10 +1442,7 @@ int ZEXPORT inflateSyncPoint( return state->mode == STORED && state->bits == 0; } -int ZEXPORT inflateCopy( - z_streamp dest, - z_streamp source) -{ +int ZEXPORT inflateCopy(z_streamp dest, z_streamp source) { struct inflate_state FAR *state; struct inflate_state FAR *copy; unsigned char FAR *window; @@ -1547,10 +1486,7 @@ int ZEXPORT inflateCopy( return Z_OK; } -int ZEXPORT inflateUndermine( - z_streamp strm, - int subvert) -{ +int ZEXPORT inflateUndermine(z_streamp strm, int subvert) { struct inflate_state FAR *state; if (inflateStateCheck(strm)) return Z_STREAM_ERROR; @@ -1565,10 +1501,7 @@ int ZEXPORT inflateUndermine( #endif } -int ZEXPORT inflateValidate( - z_streamp strm, - int check) -{ +int ZEXPORT inflateValidate(z_streamp strm, int check) { struct inflate_state FAR *state; if (inflateStateCheck(strm)) return Z_STREAM_ERROR; @@ -1580,9 +1513,7 @@ int ZEXPORT inflateValidate( return Z_OK; } -long ZEXPORT inflateMark( - z_streamp strm) -{ +long ZEXPORT inflateMark(z_streamp strm) { struct inflate_state FAR *state; if (inflateStateCheck(strm)) @@ -1593,9 +1524,7 @@ long ZEXPORT inflateMark( (state->mode == MATCH ? state->was - state->length : 0)); } -unsigned long ZEXPORT inflateCodesUsed( - z_streamp strm) -{ +unsigned long ZEXPORT inflateCodesUsed(z_streamp strm) { struct inflate_state FAR *state; if (inflateStateCheck(strm)) return (unsigned long)-1; state = (struct inflate_state FAR *)strm->state; diff --git a/vendor/freetype/src/gzip/inflate.h b/vendor/freetype/src/gzip/inflate.h index c6f5a52e16..8a0e437aea 100644 --- a/vendor/freetype/src/gzip/inflate.h +++ b/vendor/freetype/src/gzip/inflate.h @@ -128,4 +128,4 @@ struct inflate_state { unsigned was; /* initial length of match */ }; -#endif /* INFLATE_H */ +#endif /* !INFLATE_H */ diff --git a/vendor/freetype/src/gzip/inftrees.c b/vendor/freetype/src/gzip/inftrees.c index dd4965e9a8..1fd655593a 100644 --- a/vendor/freetype/src/gzip/inftrees.c +++ b/vendor/freetype/src/gzip/inftrees.c @@ -1,5 +1,5 @@ /* inftrees.c -- generate Huffman trees for efficient decoding - * Copyright (C) 1995-2022 Mark Adler + * Copyright (C) 1995-2023 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -9,7 +9,7 @@ #define MAXBITS 15 static const char inflate_copyright[] = - " inflate 1.2.13 Copyright 1995-2022 Mark Adler "; + " inflate 1.3 Copyright 1995-2023 Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot @@ -29,14 +29,9 @@ static const char inflate_copyright[] = table index bits. It will differ if the request is greater than the longest code or if it is less than the shortest code. */ -int ZLIB_INTERNAL inflate_table( - codetype type, - unsigned short FAR *lens, - unsigned codes, - code FAR * FAR *table, - unsigned FAR *bits, - unsigned short FAR *work) -{ +int ZLIB_INTERNAL inflate_table(codetype type, unsigned short FAR *lens, + unsigned codes, code FAR * FAR *table, + unsigned FAR *bits, unsigned short FAR *work) { unsigned len; /* a code's length in bits */ unsigned sym; /* index of code symbols */ unsigned min, max; /* minimum and maximum code lengths */ @@ -62,7 +57,7 @@ int ZLIB_INTERNAL inflate_table( 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; static const unsigned short lext[31] = { /* Length codes 257..285 extra */ 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, - 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 194, 65}; + 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 198, 203}; static const unsigned short dbase[32] = { /* Distance codes 0..29 base */ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, diff --git a/vendor/freetype/src/gzip/inftrees.h b/vendor/freetype/src/gzip/inftrees.h index a2207efb1f..47f726c36a 100644 --- a/vendor/freetype/src/gzip/inftrees.h +++ b/vendor/freetype/src/gzip/inftrees.h @@ -60,8 +60,8 @@ typedef enum { DISTS } codetype; -static int ZLIB_INTERNAL inflate_table OF((codetype type, unsigned short FAR *lens, - unsigned codes, code FAR * FAR *table, - unsigned FAR *bits, unsigned short FAR *work)); +static int ZLIB_INTERNAL inflate_table(codetype type, unsigned short FAR *lens, + unsigned codes, code FAR * FAR *table, + unsigned FAR *bits, unsigned short FAR *work); -#endif /* INFTREES_H_ */ +#endif /* !INFTREES_H */ diff --git a/vendor/freetype/src/gzip/patches/freetype-zlib.diff b/vendor/freetype/src/gzip/patches/freetype-zlib.diff index 6ac76df62a..9486bd02aa 100644 --- a/vendor/freetype/src/gzip/patches/freetype-zlib.diff +++ b/vendor/freetype/src/gzip/patches/freetype-zlib.diff @@ -30,88 +30,84 @@ prevent compiler errors. (inflate_table): Declare as static. diff --git b/src/gzip/adler32.c a/src/gzip/adler32.c -index be5e8a247..aa032e1dd 100644 +index 04b81d29b..260185b67 100644 --- b/src/gzip/adler32.c +++ a/src/gzip/adler32.c -@@ -7,7 +7,9 @@ - - #include "zutil.h" - -+#ifndef Z_FREETYPE - local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2)); -+#endif - - #define BASE 65521U /* largest prime smaller than 65536 */ - #define NMAX 5552 -@@ -139,6 +141,8 @@ uLong ZEXPORT adler32( +@@ -129,6 +129,8 @@ uLong ZEXPORT adler32(uLong adler, const Bytef *buf, uInt len) { return adler32_z(adler, buf, len); } +#ifndef Z_FREETYPE + /* ========================================================================= */ - local uLong adler32_combine_( - uLong adler1, -@@ -184,3 +188,5 @@ uLong ZEXPORT adler32_combine64( - { + local uLong adler32_combine_(uLong adler1, uLong adler2, z_off64_t len2) { + unsigned long sum1; +@@ -162,3 +164,5 @@ uLong ZEXPORT adler32_combine(uLong adler1, uLong adler2, z_off_t len2) { + uLong ZEXPORT adler32_combine64(uLong adler1, uLong adler2, z_off64_t len2) { return adler32_combine_(adler1, adler2, len2); } + +#endif /* !Z_FREETYPE */ diff --git b/src/gzip/crc32.c a/src/gzip/crc32.c -index 3a52aa89d..6cd1b09d5 100644 +index 6c38f5c04..27487dcc2 100644 --- b/src/gzip/crc32.c +++ a/src/gzip/crc32.c -@@ -103,9 +103,11 @@ - # define ARMCRC32 - #endif - -+#ifndef Z_FREETYPE - /* Local functions. */ - local z_crc_t multmodp OF((z_crc_t a, z_crc_t b)); - local z_crc_t x2nmodp OF((z_off64_t n, unsigned k)); -+#endif /* Z_FREETYPE */ - - #if defined(W) && (!defined(ARMCRC32) || defined(DYNAMIC_CRC_TABLE)) - local z_word_t byte_swap OF((z_word_t word)); -@@ -544,6 +546,8 @@ local void braid(ltl, big, n, w) - * generation above. - */ +@@ -148,6 +148,8 @@ local z_word_t byte_swap(z_word_t word) { + /* CRC polynomial. */ + #define POLY 0xedb88320 /* p(x) reflected, with x^32 implied */ +#ifndef Z_FREETYPE + /* Return a(x) multiplied by b(x) modulo p(x), where p(x) is the CRC polynomial, reflected. For speed, this requires that a not be zero. -@@ -600,6 +604,8 @@ const z_crc_t FAR * ZEXPORT get_crc_table() +@@ -186,6 +188,8 @@ local z_crc_t x2nmodp(z_off64_t n, unsigned k) { + return p; + } + ++#endif /* !Z_FREETYPE */ ++ + #ifdef DYNAMIC_CRC_TABLE + /* ========================================================================= + * Build the tables for byte-wise and braided CRC-32 calculations, and a table +@@ -542,6 +546,8 @@ local void braid(z_crc_t ltl[][256], z_word_t big[][256], int n, int w) { + + #endif /* DYNAMIC_CRC_TABLE */ + ++#ifndef Z_FREETYPE ++ + /* ========================================================================= + * This function can be used by asm versions of crc32(), and to force the + * generation of the CRC tables in a threaded application. +@@ -553,6 +559,8 @@ const z_crc_t FAR * ZEXPORT get_crc_table(void) { return (const z_crc_t FAR *)crc_table; } -+#endif /* Z_FREETYPE */ ++#endif /* !Z_FREETYPE */ + /* ========================================================================= * Use ARM machine instructions if available. This will compute the CRC about * ten times faster than the braided calculation. This code does not check for -@@ -1077,6 +1083,8 @@ unsigned long ZEXPORT crc32( +@@ -1017,6 +1025,8 @@ unsigned long ZEXPORT crc32(unsigned long crc, const unsigned char FAR *buf, return crc32_z(crc, buf, len); } +#ifndef Z_FREETYPE + /* ========================================================================= */ - uLong ZEXPORT crc32_combine64( - uLong crc1, -@@ -1123,3 +1131,5 @@ uLong ZEXPORT crc32_combine_op( - { + uLong ZEXPORT crc32_combine64(uLong crc1, uLong crc2, z_off64_t len2) { + #ifdef DYNAMIC_CRC_TABLE +@@ -1047,3 +1057,5 @@ uLong ZEXPORT crc32_combine_gen(z_off_t len2) { + uLong ZEXPORT crc32_combine_op(uLong crc1, uLong crc2, uLong op) { return multmodp(op, crc1) ^ (crc2 & 0xffffffff); } + -+#endif /* Z_FREETYPE */ ++#endif /* !Z_FREETYPE */ diff --git b/src/gzip/gzguts.h a/src/gzip/gzguts.h -index 57faf3716..4f09a52a7 100644 +index f9375047e..f9a250b85 100644 --- b/src/gzip/gzguts.h +++ a/src/gzip/gzguts.h -@@ -163,7 +163,7 @@ +@@ -162,7 +162,7 @@ /* values for gz_state how */ #define LOOK 0 /* look for a gzip header */ @@ -121,40 +117,29 @@ index 57faf3716..4f09a52a7 100644 /* internal gzip file state data structure */ diff --git b/src/gzip/inffast.h a/src/gzip/inffast.h -index e5c1aa4ca..684ae878c 100644 +index 49c6d156c..a38c5be45 100644 --- b/src/gzip/inffast.h +++ a/src/gzip/inffast.h @@ -8,4 +8,4 @@ subject to change. Applications should only use zlib.h. */ --void ZLIB_INTERNAL inflate_fast OF((z_streamp strm, unsigned start)); -+static void ZLIB_INTERNAL inflate_fast OF((z_streamp strm, unsigned start)); +-void ZLIB_INTERNAL inflate_fast(z_streamp strm, unsigned start); ++static void ZLIB_INTERNAL inflate_fast(z_streamp strm, unsigned start); diff --git b/src/gzip/inflate.c a/src/gzip/inflate.c -index c9e566b03..5117e2e26 100644 +index b0757a9b2..f7ed5d181 100644 --- b/src/gzip/inflate.c +++ a/src/gzip/inflate.c -@@ -99,8 +99,10 @@ local int updatewindow OF((z_streamp strm, const unsigned char FAR *end, - #ifdef BUILDFIXED - void makefixed OF((void)); - #endif -+#ifndef Z_FREETYPE - local unsigned syncsearch OF((unsigned FAR *have, const unsigned char FAR *buf, - unsigned len)); -+#endif - - local int inflateStateCheck( - z_streamp strm) -@@ -239,6 +241,8 @@ int ZEXPORT inflateInit2_( +@@ -215,6 +215,8 @@ int ZEXPORT inflateInit2_(z_streamp strm, int windowBits, return ret; } +#ifndef Z_FREETYPE + - int ZEXPORT inflateInit_( - z_streamp strm, - const char *version, -@@ -268,6 +272,8 @@ int ZEXPORT inflatePrime( + int ZEXPORT inflateInit_(z_streamp strm, const char *version, + int stream_size) { + return inflateInit2_(strm, DEF_WBITS, version, stream_size); +@@ -239,6 +241,8 @@ int ZEXPORT inflatePrime(z_streamp strm, int bits, int value) { return Z_OK; } @@ -163,23 +148,23 @@ index c9e566b03..5117e2e26 100644 /* Return state with length and distance decoding tables and index sizes set to fixed code decoding. Normally this returns fixed tables from inffixed.h. -@@ -1315,6 +1321,8 @@ int ZEXPORT inflateEnd( +@@ -1275,6 +1279,8 @@ int ZEXPORT inflateEnd(z_streamp strm) { return Z_OK; } +#ifndef Z_FREETYPE + - int ZEXPORT inflateGetDictionary( - z_streamp strm, - Bytef *dictionary, -@@ -1593,3 +1601,5 @@ unsigned long ZEXPORT inflateCodesUsed( + int ZEXPORT inflateGetDictionary(z_streamp strm, Bytef *dictionary, + uInt *dictLength) { + struct inflate_state FAR *state; +@@ -1524,3 +1530,5 @@ unsigned long ZEXPORT inflateCodesUsed(z_streamp strm) { state = (struct inflate_state FAR *)strm->state; return (unsigned long)(state->next - state->codes); } + +#endif /* !Z_FREETYPE */ diff --git b/src/gzip/inflate.h a/src/gzip/inflate.h -index f127b6b1f..c6f5a52e1 100644 +index f127b6b1f..8a0e437ae 100644 --- b/src/gzip/inflate.h +++ a/src/gzip/inflate.h @@ -3,6 +3,9 @@ @@ -197,9 +182,9 @@ index f127b6b1f..c6f5a52e1 100644 unsigned was; /* initial length of match */ }; + -+#endif /* INFLATE_H */ ++#endif /* !INFLATE_H */ diff --git b/src/gzip/inftrees.c a/src/gzip/inftrees.c -index d8405a24c..dd4965e9a 100644 +index 8a208c2da..1fd655593 100644 --- b/src/gzip/inftrees.c +++ a/src/gzip/inftrees.c @@ -8,7 +8,7 @@ @@ -208,11 +193,11 @@ index d8405a24c..dd4965e9a 100644 -const char inflate_copyright[] = +static const char inflate_copyright[] = - " inflate 1.2.13 Copyright 1995-2022 Mark Adler "; + " inflate 1.3 Copyright 1995-2023 Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome diff --git b/src/gzip/inftrees.h a/src/gzip/inftrees.h -index f53665311..a2207efb1 100644 +index a10712d8c..47f726c36 100644 --- b/src/gzip/inftrees.h +++ a/src/gzip/inftrees.h @@ -3,6 +3,9 @@ @@ -229,14 +214,14 @@ index f53665311..a2207efb1 100644 DISTS } codetype; --int ZLIB_INTERNAL inflate_table OF((codetype type, unsigned short FAR *lens, -+static int ZLIB_INTERNAL inflate_table OF((codetype type, unsigned short FAR *lens, - unsigned codes, code FAR * FAR *table, - unsigned FAR *bits, unsigned short FAR *work)); +-int ZLIB_INTERNAL inflate_table(codetype type, unsigned short FAR *lens, ++static int ZLIB_INTERNAL inflate_table(codetype type, unsigned short FAR *lens, + unsigned codes, code FAR * FAR *table, + unsigned FAR *bits, unsigned short FAR *work); + -+#endif /* INFTREES_H_ */ ++#endif /* !INFTREES_H */ diff --git b/src/gzip/zlib.h a/src/gzip/zlib.h -index 953cb5012..3f2f76e3c 100644 +index 6b7244f99..5c7a884c9 100644 --- b/src/gzip/zlib.h +++ a/src/gzip/zlib.h @@ -31,7 +31,7 @@ @@ -257,60 +242,60 @@ index 953cb5012..3f2f76e3c 100644 #define zlib_version zlibVersion() /* for compatibility with versions < 1.0.2 */ -@@ -373,6 +375,7 @@ ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm)); +@@ -373,6 +375,7 @@ ZEXTERN int ZEXPORT deflateEnd(z_streamp strm); deallocated). */ +#endif /* !Z_FREETYPE */ /* - ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); -@@ -534,6 +537,8 @@ ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm)); + ZEXTERN int ZEXPORT inflateInit(z_streamp strm); +@@ -535,6 +538,8 @@ ZEXTERN int ZEXPORT inflateEnd(z_streamp strm); The following functions are needed only in some special applications. */ +#ifndef Z_FREETYPE + /* - ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, - int level, -@@ -956,6 +961,8 @@ ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest, + ZEXTERN int ZEXPORT deflateInit2(z_streamp strm, + int level, +@@ -958,6 +963,8 @@ ZEXTERN int ZEXPORT inflateCopy(z_streamp dest, destination. */ +#endif /* !Z_FREETYPE */ + - ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm)); + ZEXTERN int ZEXPORT inflateReset(z_streamp strm); /* This function is equivalent to inflateEnd followed by inflateInit, -@@ -980,6 +987,8 @@ ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm, +@@ -983,6 +990,8 @@ ZEXTERN int ZEXPORT inflateReset2(z_streamp strm, the windowBits parameter is invalid. */ +#ifndef Z_FREETYPE + - ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm, - int bits, - int value)); -@@ -1069,6 +1078,8 @@ ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm, + ZEXTERN int ZEXPORT inflatePrime(z_streamp strm, + int bits, + int value); +@@ -1072,6 +1081,8 @@ ZEXTERN int ZEXPORT inflateGetHeader(z_streamp strm, stream state was inconsistent. */ +#endif /* !Z_FREETYPE */ + /* - ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits, - unsigned char FAR *window)); -@@ -1095,6 +1106,8 @@ typedef unsigned (*in_func) OF((void FAR *, - z_const unsigned char FAR * FAR *)); - typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned)); + ZEXTERN int ZEXPORT inflateBackInit(z_streamp strm, int windowBits, + unsigned char FAR *window); +@@ -1098,6 +1109,8 @@ typedef unsigned (*in_func)(void FAR *, + z_const unsigned char FAR * FAR *); + typedef int (*out_func)(void FAR *, unsigned char FAR *, unsigned); +#ifndef Z_FREETYPE + - ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm, - in_func in, void FAR *in_desc, - out_func out, void FAR *out_desc)); -@@ -1214,6 +1227,8 @@ ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void)); + ZEXTERN int ZEXPORT inflateBack(z_streamp strm, + in_func in, void FAR *in_desc, + out_func out, void FAR *out_desc); +@@ -1217,6 +1230,8 @@ ZEXTERN uLong ZEXPORT zlibCompileFlags(void); 27-31: 0 (reserved) */ @@ -319,63 +304,61 @@ index 953cb5012..3f2f76e3c 100644 #ifndef Z_SOLO /* utility functions */ -@@ -1765,6 +1780,8 @@ ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t len2)); +@@ -1768,6 +1783,8 @@ ZEXTERN uLong ZEXPORT crc32_combine_gen(z_off_t len2); crc32_combine_op(). */ +#ifndef Z_FREETYPE + - ZEXTERN uLong ZEXPORT crc32_combine_op OF((uLong crc1, uLong crc2, uLong op)); + ZEXTERN uLong ZEXPORT crc32_combine_op(uLong crc1, uLong crc2, uLong op); /* Give the same result as crc32_combine(), using op in place of len2. op is -@@ -1822,6 +1839,19 @@ ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits, +@@ -1825,6 +1842,17 @@ ZEXTERN int ZEXPORT inflateBackInit_(z_streamp strm, int windowBits, ZLIB_VERSION, (int)sizeof(z_stream)) #endif +#else /* Z_FREETYPE */ + -+ -+ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits, -+ const char *version, int stream_size)); ++ZEXTERN int ZEXPORT inflateInit2_(z_streamp strm, int windowBits, ++ const char *version, int stream_size); + +# define inflateInit2(strm, windowBits) \ + inflateInit2_((strm), (windowBits), ZLIB_VERSION, \ + (int)sizeof(z_stream)) + +#endif /* Z_FREETYPE */ -+ + #ifndef Z_SOLO /* gzgetc() macro and its supporting function and exposed data structure. Note -@@ -1901,20 +1931,25 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */ +@@ -1904,20 +1932,25 @@ ZEXTERN int ZEXPORT gzgetc_(gzFile file); /* backward compatibility */ #else /* Z_SOLO */ +#ifndef Z_FREETYPE - ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t)); - ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t)); - ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t)); + ZEXTERN uLong ZEXPORT adler32_combine(uLong, uLong, z_off_t); + ZEXTERN uLong ZEXPORT crc32_combine(uLong, uLong, z_off_t); + ZEXTERN uLong ZEXPORT crc32_combine_gen(z_off_t); +#endif #endif /* !Z_SOLO */ /* undocumented functions */ +#ifndef Z_FREETYPE - ZEXTERN const char * ZEXPORT zError OF((int)); - ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp)); - ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table OF((void)); - ZEXTERN int ZEXPORT inflateUndermine OF((z_streamp, int)); - ZEXTERN int ZEXPORT inflateValidate OF((z_streamp, int)); - ZEXTERN unsigned long ZEXPORT inflateCodesUsed OF((z_streamp)); + ZEXTERN const char * ZEXPORT zError(int); + ZEXTERN int ZEXPORT inflateSyncPoint(z_streamp); + ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table(void); + ZEXTERN int ZEXPORT inflateUndermine(z_streamp, int); + ZEXTERN int ZEXPORT inflateValidate(z_streamp, int); + ZEXTERN unsigned long ZEXPORT inflateCodesUsed(z_streamp); +#endif /* !Z_FREETYPE */ - ZEXTERN int ZEXPORT inflateResetKeep OF((z_streamp)); + ZEXTERN int ZEXPORT inflateResetKeep(z_streamp); +#ifndef Z_FREETYPE - ZEXTERN int ZEXPORT deflateResetKeep OF((z_streamp)); + ZEXTERN int ZEXPORT deflateResetKeep(z_streamp); #if defined(_WIN32) && !defined(Z_SOLO) - ZEXTERN gzFile ZEXPORT gzopen_w OF((const wchar_t *path, -@@ -1927,6 +1962,7 @@ ZEXTERN int ZEXPORTVA gzvprintf Z_ARG((gzFile file, - va_list va)); + ZEXTERN gzFile ZEXPORT gzopen_w(const wchar_t *path, +@@ -1930,6 +1963,7 @@ ZEXTERN int ZEXPORTVA gzvprintf(gzFile file, + va_list va); # endif #endif +#endif /* !Z_FREETYPE */ @@ -383,7 +366,7 @@ index 953cb5012..3f2f76e3c 100644 #ifdef __cplusplus } diff --git b/src/gzip/zutil.c a/src/gzip/zutil.c -index ef174ca64..542706ca0 100644 +index b1c5d2d3c..f76def425 100644 --- b/src/gzip/zutil.c +++ a/src/gzip/zutil.c @@ -10,6 +10,8 @@ @@ -395,7 +378,7 @@ index ef174ca64..542706ca0 100644 z_const char * const z_errmsg[10] = { (z_const char *)"need dictionary", /* Z_NEED_DICT 2 */ (z_const char *)"stream end", /* Z_STREAM_END 1 */ -@@ -138,6 +140,8 @@ const char * ZEXPORT zError( +@@ -132,6 +134,8 @@ const char * ZEXPORT zError(int err) { return ERR_MSG(err); } @@ -404,16 +387,15 @@ index ef174ca64..542706ca0 100644 #if defined(_WIN32_WCE) && _WIN32_WCE < 0x800 /* The older Microsoft C Run-Time Library for Windows CE doesn't have * errno. We define it as a global variable to simplify porting. -@@ -159,6 +163,8 @@ void ZLIB_INTERNAL zmemcpy( +@@ -149,6 +153,7 @@ void ZLIB_INTERNAL zmemcpy(Bytef* dest, const Bytef* source, uInt len) { } while (--len != 0); } +#ifndef Z_FREETYPE -+ - int ZLIB_INTERNAL zmemcmp( - const Bytef* s1, - const Bytef* s2, -@@ -181,6 +187,7 @@ void ZLIB_INTERNAL zmemzero( + int ZLIB_INTERNAL zmemcmp(const Bytef* s1, const Bytef* s2, uInt len) { + uInt j; + +@@ -164,6 +169,7 @@ void ZLIB_INTERNAL zmemzero(Bytef* dest, uInt len) { *dest++ = 0; /* ??? to be unrolled */ } while (--len != 0); } @@ -422,7 +404,7 @@ index ef174ca64..542706ca0 100644 #ifndef Z_SOLO diff --git b/src/gzip/zutil.h a/src/gzip/zutil.h -index 0bc7f4ecd..055ba8b62 100644 +index 902a304cc..a2c046a1f 100644 --- b/src/gzip/zutil.h +++ a/src/gzip/zutil.h @@ -53,8 +53,10 @@ typedef unsigned long ulg; @@ -432,7 +414,7 @@ index 0bc7f4ecd..055ba8b62 100644 +#ifndef Z_FREETYPE extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ /* (size given to avoid silly warnings with Visual C++) */ -+#endif /* !Z_FREETYPE */ ++#endif #define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)] @@ -446,7 +428,7 @@ index 0bc7f4ecd..055ba8b62 100644 #if !defined(_WIN32) && \ (!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0) @@ -196,6 +200,8 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ - ZEXTERN uLong ZEXPORT crc32_combine_gen64 OF((z_off_t)); + ZEXTERN uLong ZEXPORT crc32_combine_gen64(z_off_t); #endif +#endif /* !Z_FREETYPE */ @@ -466,4 +448,4 @@ index 0bc7f4ecd..055ba8b62 100644 +# define zmemzero(dest, len) ft_memset(dest, 0, len) # endif #else - void ZLIB_INTERNAL zmemcpy OF((Bytef* dest, const Bytef* source, uInt len)); + void ZLIB_INTERNAL zmemcpy(Bytef* dest, const Bytef* source, uInt len); diff --git a/vendor/freetype/src/gzip/zlib.h b/vendor/freetype/src/gzip/zlib.h index 3f2f76e3ca..5c7a884c93 100644 --- a/vendor/freetype/src/gzip/zlib.h +++ b/vendor/freetype/src/gzip/zlib.h @@ -1,7 +1,7 @@ /* zlib.h -- interface of the 'zlib' general purpose compression library - version 1.2.13, October 13th, 2022 + version 1.3, August 18th, 2023 - Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler + Copyright (C) 1995-2023 Jean-loup Gailly and Mark Adler This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -37,11 +37,11 @@ extern "C" { #endif -#define ZLIB_VERSION "1.2.13" -#define ZLIB_VERNUM 0x12d0 +#define ZLIB_VERSION "1.3" +#define ZLIB_VERNUM 0x1300 #define ZLIB_VER_MAJOR 1 -#define ZLIB_VER_MINOR 2 -#define ZLIB_VER_REVISION 13 +#define ZLIB_VER_MINOR 3 +#define ZLIB_VER_REVISION 0 #define ZLIB_VER_SUBREVISION 0 /* @@ -78,8 +78,8 @@ extern "C" { even in the case of corrupted input. */ -typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size)); -typedef void (*free_func) OF((voidpf opaque, voidpf address)); +typedef voidpf (*alloc_func)(voidpf opaque, uInt items, uInt size); +typedef void (*free_func)(voidpf opaque, voidpf address); struct internal_state; @@ -219,7 +219,7 @@ typedef gz_header FAR *gz_headerp; /* basic functions */ -ZEXTERN const char * ZEXPORT zlibVersion OF((void)); +ZEXTERN const char * ZEXPORT zlibVersion(void); /* The application can compare zlibVersion and ZLIB_VERSION for consistency. If the first character differs, the library code actually used is not compatible with the zlib.h header file used by the application. This check @@ -227,12 +227,12 @@ ZEXTERN const char * ZEXPORT zlibVersion OF((void)); */ /* -ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level)); +ZEXTERN int ZEXPORT deflateInit(z_streamp strm, int level); Initializes the internal stream state for compression. The fields zalloc, zfree and opaque must be initialized before by the caller. If zalloc and zfree are set to Z_NULL, deflateInit updates them to use default - allocation functions. + allocation functions. total_in, total_out, adler, and msg are initialized. The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: 1 gives best speed, 9 gives best compression, 0 gives no compression at all @@ -249,7 +249,7 @@ ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level)); */ -ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); +ZEXTERN int ZEXPORT deflate(z_streamp strm, int flush); /* deflate compresses as much data as possible, and stops when the input buffer becomes empty or the output buffer becomes full. It may introduce @@ -322,8 +322,8 @@ ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); with the same value of the flush parameter and more output space (updated avail_out), until the flush is complete (deflate returns with non-zero avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that - avail_out is greater than six to avoid repeated flush markers due to - avail_out == 0 on return. + avail_out is greater than six when the flush marker begins, in order to avoid + repeated flush markers upon calling deflate() again when avail_out == 0. If the parameter flush is set to Z_FINISH, pending input is processed, pending output is flushed and deflate returns with Z_STREAM_END if there was @@ -362,7 +362,7 @@ ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); */ -ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm)); +ZEXTERN int ZEXPORT deflateEnd(z_streamp strm); /* All dynamically allocated data structures for this stream are freed. This function discards any unprocessed input and does not flush any pending @@ -378,7 +378,7 @@ ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm)); #endif /* !Z_FREETYPE */ /* -ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); +ZEXTERN int ZEXPORT inflateInit(z_streamp strm); Initializes the internal stream state for decompression. The fields next_in, avail_in, zalloc, zfree and opaque must be initialized before by @@ -386,7 +386,8 @@ ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); read or consumed. The allocation of a sliding window will be deferred to the first call of inflate (if the decompression does not complete on the first call). If zalloc and zfree are set to Z_NULL, inflateInit updates - them to use default allocation functions. + them to use default allocation functions. total_in, total_out, adler, and + msg are initialized. inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_VERSION_ERROR if the zlib library version is incompatible with the @@ -400,7 +401,7 @@ ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); */ -ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); +ZEXTERN int ZEXPORT inflate(z_streamp strm, int flush); /* inflate decompresses as much data as possible, and stops when the input buffer becomes empty or the output buffer becomes full. It may introduce @@ -520,7 +521,7 @@ ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); */ -ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm)); +ZEXTERN int ZEXPORT inflateEnd(z_streamp strm); /* All dynamically allocated data structures for this stream are freed. This function discards any unprocessed input and does not flush any pending @@ -540,12 +541,12 @@ ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm)); #ifndef Z_FREETYPE /* -ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, - int level, - int method, - int windowBits, - int memLevel, - int strategy)); +ZEXTERN int ZEXPORT deflateInit2(z_streamp strm, + int level, + int method, + int windowBits, + int memLevel, + int strategy); This is another version of deflateInit with more compression options. The fields zalloc, zfree and opaque must be initialized before by the caller. @@ -612,9 +613,9 @@ ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, compression: this will be done by deflate(). */ -ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, - const Bytef *dictionary, - uInt dictLength)); +ZEXTERN int ZEXPORT deflateSetDictionary(z_streamp strm, + const Bytef *dictionary, + uInt dictLength); /* Initializes the compression dictionary from the given byte sequence without producing any compressed output. When using the zlib format, this @@ -656,9 +657,9 @@ ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, not perform any compression: this will be done by deflate(). */ -ZEXTERN int ZEXPORT deflateGetDictionary OF((z_streamp strm, - Bytef *dictionary, - uInt *dictLength)); +ZEXTERN int ZEXPORT deflateGetDictionary(z_streamp strm, + Bytef *dictionary, + uInt *dictLength); /* Returns the sliding dictionary being maintained by deflate. dictLength is set to the number of bytes in the dictionary, and that many bytes are copied @@ -678,8 +679,8 @@ ZEXTERN int ZEXPORT deflateGetDictionary OF((z_streamp strm, stream state is inconsistent. */ -ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest, - z_streamp source)); +ZEXTERN int ZEXPORT deflateCopy(z_streamp dest, + z_streamp source); /* Sets the destination stream as a complete copy of the source stream. @@ -696,20 +697,20 @@ ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest, destination. */ -ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm)); +ZEXTERN int ZEXPORT deflateReset(z_streamp strm); /* This function is equivalent to deflateEnd followed by deflateInit, but does not free and reallocate the internal compression state. The stream will leave the compression level and any other attributes that may have been - set unchanged. + set unchanged. total_in, total_out, adler, and msg are initialized. deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc or state being Z_NULL). */ -ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, - int level, - int strategy)); +ZEXTERN int ZEXPORT deflateParams(z_streamp strm, + int level, + int strategy); /* Dynamically update the compression level and compression strategy. The interpretation of level and strategy is as in deflateInit2(). This can be @@ -734,7 +735,7 @@ ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, Then no more input data should be provided before the deflateParams() call. If this is done, the old level and strategy will be applied to the data compressed before deflateParams(), and the new level and strategy will be - applied to the the data compressed after deflateParams(). + applied to the data compressed after deflateParams(). deflateParams returns Z_OK on success, Z_STREAM_ERROR if the source stream state was inconsistent or if a parameter was invalid, or Z_BUF_ERROR if @@ -745,11 +746,11 @@ ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, retried with more output space. */ -ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm, - int good_length, - int max_lazy, - int nice_length, - int max_chain)); +ZEXTERN int ZEXPORT deflateTune(z_streamp strm, + int good_length, + int max_lazy, + int nice_length, + int max_chain); /* Fine tune deflate's internal compression parameters. This should only be used by someone who understands the algorithm used by zlib's deflate for @@ -762,8 +763,8 @@ ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm, returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream. */ -ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm, - uLong sourceLen)); +ZEXTERN uLong ZEXPORT deflateBound(z_streamp strm, + uLong sourceLen); /* deflateBound() returns an upper bound on the compressed size after deflation of sourceLen bytes. It must be called after deflateInit() or @@ -777,9 +778,9 @@ ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm, than Z_FINISH or Z_NO_FLUSH are used. */ -ZEXTERN int ZEXPORT deflatePending OF((z_streamp strm, - unsigned *pending, - int *bits)); +ZEXTERN int ZEXPORT deflatePending(z_streamp strm, + unsigned *pending, + int *bits); /* deflatePending() returns the number of bytes and bits of output that have been generated, but not yet provided in the available output. The bytes not @@ -792,9 +793,9 @@ ZEXTERN int ZEXPORT deflatePending OF((z_streamp strm, stream state was inconsistent. */ -ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm, - int bits, - int value)); +ZEXTERN int ZEXPORT deflatePrime(z_streamp strm, + int bits, + int value); /* deflatePrime() inserts bits in the deflate output stream. The intent is that this function is used to start off the deflate output with the bits @@ -809,8 +810,8 @@ ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm, source stream state was inconsistent. */ -ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm, - gz_headerp head)); +ZEXTERN int ZEXPORT deflateSetHeader(z_streamp strm, + gz_headerp head); /* deflateSetHeader() provides gzip header information for when a gzip stream is requested by deflateInit2(). deflateSetHeader() may be called @@ -826,16 +827,17 @@ ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm, gzip file" and give up. If deflateSetHeader is not used, the default gzip header has text false, - the time set to zero, and os set to 255, with no extra, name, or comment - fields. The gzip header is returned to the default state by deflateReset(). + the time set to zero, and os set to the current operating system, with no + extra, name, or comment fields. The gzip header is returned to the default + state by deflateReset(). deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent. */ /* -ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, - int windowBits)); +ZEXTERN int ZEXPORT inflateInit2(z_streamp strm, + int windowBits); This is another version of inflateInit with an extra parameter. The fields next_in, avail_in, zalloc, zfree and opaque must be initialized @@ -888,9 +890,9 @@ ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, deferred until inflate() is called. */ -ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, - const Bytef *dictionary, - uInt dictLength)); +ZEXTERN int ZEXPORT inflateSetDictionary(z_streamp strm, + const Bytef *dictionary, + uInt dictLength); /* Initializes the decompression dictionary from the given uncompressed byte sequence. This function must be called immediately after a call of inflate, @@ -911,9 +913,9 @@ ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, inflate(). */ -ZEXTERN int ZEXPORT inflateGetDictionary OF((z_streamp strm, - Bytef *dictionary, - uInt *dictLength)); +ZEXTERN int ZEXPORT inflateGetDictionary(z_streamp strm, + Bytef *dictionary, + uInt *dictLength); /* Returns the sliding dictionary being maintained by inflate. dictLength is set to the number of bytes in the dictionary, and that many bytes are copied @@ -926,7 +928,7 @@ ZEXTERN int ZEXPORT inflateGetDictionary OF((z_streamp strm, stream state is inconsistent. */ -ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm)); +ZEXTERN int ZEXPORT inflateSync(z_streamp strm); /* Skips invalid compressed data until a possible full flush point (see above for the description of deflate with Z_FULL_FLUSH) can be found, or until all @@ -945,8 +947,8 @@ ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm)); input each time, until success or end of the input data. */ -ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest, - z_streamp source)); +ZEXTERN int ZEXPORT inflateCopy(z_streamp dest, + z_streamp source); /* Sets the destination stream as a complete copy of the source stream. @@ -963,18 +965,19 @@ ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest, #endif /* !Z_FREETYPE */ -ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm)); +ZEXTERN int ZEXPORT inflateReset(z_streamp strm); /* This function is equivalent to inflateEnd followed by inflateInit, but does not free and reallocate the internal decompression state. The stream will keep attributes that may have been set by inflateInit2. + total_in, total_out, adler, and msg are initialized. inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc or state being Z_NULL). */ -ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm, - int windowBits)); +ZEXTERN int ZEXPORT inflateReset2(z_streamp strm, + int windowBits); /* This function is the same as inflateReset, but it also permits changing the wrap and window size requests. The windowBits parameter is interpreted @@ -989,9 +992,9 @@ ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm, #ifndef Z_FREETYPE -ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm, - int bits, - int value)); +ZEXTERN int ZEXPORT inflatePrime(z_streamp strm, + int bits, + int value); /* This function inserts bits in the inflate input stream. The intent is that this function is used to start inflating at a bit position in the @@ -1010,7 +1013,7 @@ ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm, stream state was inconsistent. */ -ZEXTERN long ZEXPORT inflateMark OF((z_streamp strm)); +ZEXTERN long ZEXPORT inflateMark(z_streamp strm); /* This function returns two values, one in the lower 16 bits of the return value, and the other in the remaining upper bits, obtained by shifting the @@ -1038,8 +1041,8 @@ ZEXTERN long ZEXPORT inflateMark OF((z_streamp strm)); source stream state was inconsistent. */ -ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm, - gz_headerp head)); +ZEXTERN int ZEXPORT inflateGetHeader(z_streamp strm, + gz_headerp head); /* inflateGetHeader() requests that gzip header information be stored in the provided gz_header structure. inflateGetHeader() may be called after @@ -1081,8 +1084,8 @@ ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm, #endif /* !Z_FREETYPE */ /* -ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits, - unsigned char FAR *window)); +ZEXTERN int ZEXPORT inflateBackInit(z_streamp strm, int windowBits, + unsigned char FAR *window); Initialize the internal stream state for decompression using inflateBack() calls. The fields zalloc, zfree and opaque in strm must be initialized @@ -1102,15 +1105,15 @@ ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits, the version of the header file. */ -typedef unsigned (*in_func) OF((void FAR *, - z_const unsigned char FAR * FAR *)); -typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned)); +typedef unsigned (*in_func)(void FAR *, + z_const unsigned char FAR * FAR *); +typedef int (*out_func)(void FAR *, unsigned char FAR *, unsigned); #ifndef Z_FREETYPE -ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm, - in_func in, void FAR *in_desc, - out_func out, void FAR *out_desc)); +ZEXTERN int ZEXPORT inflateBack(z_streamp strm, + in_func in, void FAR *in_desc, + out_func out, void FAR *out_desc); /* inflateBack() does a raw inflate with a single call using a call-back interface for input and output. This is potentially more efficient than @@ -1178,7 +1181,7 @@ ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm, cannot return Z_OK. */ -ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm)); +ZEXTERN int ZEXPORT inflateBackEnd(z_streamp strm); /* All memory allocated by inflateBackInit() is freed. @@ -1186,7 +1189,7 @@ ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm)); state was inconsistent. */ -ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void)); +ZEXTERN uLong ZEXPORT zlibCompileFlags(void); /* Return flags indicating compile-time options. Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other: @@ -1241,8 +1244,8 @@ ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void)); you need special options. */ -ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen)); +ZEXTERN int ZEXPORT compress(Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen); /* Compresses the source buffer into the destination buffer. sourceLen is the byte length of the source buffer. Upon entry, destLen is the total size @@ -1256,9 +1259,9 @@ ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen, buffer. */ -ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen, - int level)); +ZEXTERN int ZEXPORT compress2(Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen, + int level); /* Compresses the source buffer into the destination buffer. The level parameter has the same meaning as in deflateInit. sourceLen is the byte @@ -1272,15 +1275,15 @@ ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen, Z_STREAM_ERROR if the level parameter is invalid. */ -ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen)); +ZEXTERN uLong ZEXPORT compressBound(uLong sourceLen); /* compressBound() returns an upper bound on the compressed size after compress() or compress2() on sourceLen bytes. It would be used before a compress() or compress2() call to allocate the destination buffer. */ -ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen)); +ZEXTERN int ZEXPORT uncompress(Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen); /* Decompresses the source buffer into the destination buffer. sourceLen is the byte length of the source buffer. Upon entry, destLen is the total size @@ -1297,8 +1300,8 @@ ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen, buffer with the uncompressed data up to that point. */ -ZEXTERN int ZEXPORT uncompress2 OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong *sourceLen)); +ZEXTERN int ZEXPORT uncompress2(Bytef *dest, uLongf *destLen, + const Bytef *source, uLong *sourceLen); /* Same as uncompress, except that sourceLen is a pointer, where the length of the source is *sourceLen. On return, *sourceLen is the number of @@ -1317,7 +1320,7 @@ ZEXTERN int ZEXPORT uncompress2 OF((Bytef *dest, uLongf *destLen, typedef struct gzFile_s *gzFile; /* semi-opaque gzip file descriptor */ /* -ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); +ZEXTERN gzFile ZEXPORT gzopen(const char *path, const char *mode); Open the gzip (.gz) file at path for reading and decompressing, or compressing and writing. The mode parameter is as in fopen ("rb" or "wb") @@ -1354,7 +1357,7 @@ ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); file could not be opened. */ -ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode)); +ZEXTERN gzFile ZEXPORT gzdopen(int fd, const char *mode); /* Associate a gzFile with the file descriptor fd. File descriptors are obtained from calls like open, dup, creat, pipe or fileno (if the file has @@ -1377,7 +1380,7 @@ ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode)); will not detect if fd is invalid (unless fd is -1). */ -ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size)); +ZEXTERN int ZEXPORT gzbuffer(gzFile file, unsigned size); /* Set the internal buffer size used by this library's functions for file to size. The default buffer size is 8192 bytes. This function must be called @@ -1393,7 +1396,7 @@ ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size)); too late. */ -ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy)); +ZEXTERN int ZEXPORT gzsetparams(gzFile file, int level, int strategy); /* Dynamically update the compression level and strategy for file. See the description of deflateInit2 for the meaning of these parameters. Previously @@ -1404,7 +1407,7 @@ ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy)); or Z_MEM_ERROR if there is a memory allocation error. */ -ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); +ZEXTERN int ZEXPORT gzread(gzFile file, voidp buf, unsigned len); /* Read and decompress up to len uncompressed bytes from file into buf. If the input file is not in gzip format, gzread copies the given number of @@ -1434,8 +1437,8 @@ ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); Z_STREAM_ERROR. */ -ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems, - gzFile file)); +ZEXTERN z_size_t ZEXPORT gzfread(voidp buf, z_size_t size, z_size_t nitems, + gzFile file); /* Read and decompress up to nitems items of size size from file into buf, otherwise operating as gzread() does. This duplicates the interface of @@ -1460,14 +1463,14 @@ ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems, file, resetting and retrying on end-of-file, when size is not 1. */ -ZEXTERN int ZEXPORT gzwrite OF((gzFile file, voidpc buf, unsigned len)); +ZEXTERN int ZEXPORT gzwrite(gzFile file, voidpc buf, unsigned len); /* Compress and write the len uncompressed bytes at buf to file. gzwrite returns the number of uncompressed bytes written or 0 in case of error. */ -ZEXTERN z_size_t ZEXPORT gzfwrite OF((voidpc buf, z_size_t size, - z_size_t nitems, gzFile file)); +ZEXTERN z_size_t ZEXPORT gzfwrite(voidpc buf, z_size_t size, + z_size_t nitems, gzFile file); /* Compress and write nitems items of size size from buf to file, duplicating the interface of stdio's fwrite(), with size_t request and return types. If @@ -1480,7 +1483,7 @@ ZEXTERN z_size_t ZEXPORT gzfwrite OF((voidpc buf, z_size_t size, is returned, and the error state is set to Z_STREAM_ERROR. */ -ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...)); +ZEXTERN int ZEXPORTVA gzprintf(gzFile file, const char *format, ...); /* Convert, format, compress, and write the arguments (...) to file under control of the string format, as in fprintf. gzprintf returns the number of @@ -1495,7 +1498,7 @@ ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...)); This can be determined using zlibCompileFlags(). */ -ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s)); +ZEXTERN int ZEXPORT gzputs(gzFile file, const char *s); /* Compress and write the given null-terminated string s to file, excluding the terminating null character. @@ -1503,7 +1506,7 @@ ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s)); gzputs returns the number of characters written, or -1 in case of error. */ -ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len)); +ZEXTERN char * ZEXPORT gzgets(gzFile file, char *buf, int len); /* Read and decompress bytes from file into buf, until len-1 characters are read, or until a newline character is read and transferred to buf, or an @@ -1517,13 +1520,13 @@ ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len)); buf are indeterminate. */ -ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c)); +ZEXTERN int ZEXPORT gzputc(gzFile file, int c); /* Compress and write c, converted to an unsigned char, into file. gzputc returns the value that was written, or -1 in case of error. */ -ZEXTERN int ZEXPORT gzgetc OF((gzFile file)); +ZEXTERN int ZEXPORT gzgetc(gzFile file); /* Read and decompress one byte from file. gzgetc returns this byte or -1 in case of end of file or error. This is implemented as a macro for speed. @@ -1532,7 +1535,7 @@ ZEXTERN int ZEXPORT gzgetc OF((gzFile file)); points to has been clobbered or not. */ -ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file)); +ZEXTERN int ZEXPORT gzungetc(int c, gzFile file); /* Push c back onto the stream for file to be read as the first character on the next read. At least one character of push-back is always allowed. @@ -1544,7 +1547,7 @@ ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file)); gzseek() or gzrewind(). */ -ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush)); +ZEXTERN int ZEXPORT gzflush(gzFile file, int flush); /* Flush all pending output to file. The parameter flush is as in the deflate() function. The return value is the zlib error number (see function @@ -1560,8 +1563,8 @@ ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush)); */ /* -ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file, - z_off_t offset, int whence)); +ZEXTERN z_off_t ZEXPORT gzseek(gzFile file, + z_off_t offset, int whence); Set the starting position to offset relative to whence for the next gzread or gzwrite on file. The offset represents a number of bytes in the @@ -1579,7 +1582,7 @@ ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file, would be before the current position. */ -ZEXTERN int ZEXPORT gzrewind OF((gzFile file)); +ZEXTERN int ZEXPORT gzrewind(gzFile file); /* Rewind file. This function is supported only for reading. @@ -1587,7 +1590,7 @@ ZEXTERN int ZEXPORT gzrewind OF((gzFile file)); */ /* -ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file)); +ZEXTERN z_off_t ZEXPORT gztell(gzFile file); Return the starting position for the next gzread or gzwrite on file. This position represents a number of bytes in the uncompressed data stream, @@ -1598,7 +1601,7 @@ ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file)); */ /* -ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file)); +ZEXTERN z_off_t ZEXPORT gzoffset(gzFile file); Return the current compressed (actual) read or write offset of file. This offset includes the count of bytes that precede the gzip stream, for example @@ -1607,7 +1610,7 @@ ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file)); be used for a progress indicator. On error, gzoffset() returns -1. */ -ZEXTERN int ZEXPORT gzeof OF((gzFile file)); +ZEXTERN int ZEXPORT gzeof(gzFile file); /* Return true (1) if the end-of-file indicator for file has been set while reading, false (0) otherwise. Note that the end-of-file indicator is set @@ -1622,7 +1625,7 @@ ZEXTERN int ZEXPORT gzeof OF((gzFile file)); has grown since the previous end of file was detected. */ -ZEXTERN int ZEXPORT gzdirect OF((gzFile file)); +ZEXTERN int ZEXPORT gzdirect(gzFile file); /* Return true (1) if file is being copied directly while reading, or false (0) if file is a gzip stream being decompressed. @@ -1643,7 +1646,7 @@ ZEXTERN int ZEXPORT gzdirect OF((gzFile file)); gzip file reading and decompression, which may not be desired.) */ -ZEXTERN int ZEXPORT gzclose OF((gzFile file)); +ZEXTERN int ZEXPORT gzclose(gzFile file); /* Flush all pending output for file, if necessary, close file and deallocate the (de)compression state. Note that once file is closed, you @@ -1656,8 +1659,8 @@ ZEXTERN int ZEXPORT gzclose OF((gzFile file)); last read ended in the middle of a gzip stream, or Z_OK on success. */ -ZEXTERN int ZEXPORT gzclose_r OF((gzFile file)); -ZEXTERN int ZEXPORT gzclose_w OF((gzFile file)); +ZEXTERN int ZEXPORT gzclose_r(gzFile file); +ZEXTERN int ZEXPORT gzclose_w(gzFile file); /* Same as gzclose(), but gzclose_r() is only for use when reading, and gzclose_w() is only for use when writing or appending. The advantage to @@ -1668,7 +1671,7 @@ ZEXTERN int ZEXPORT gzclose_w OF((gzFile file)); zlib library. */ -ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum)); +ZEXTERN const char * ZEXPORT gzerror(gzFile file, int *errnum); /* Return the error message for the last error which occurred on file. errnum is set to zlib error number. If an error occurred in the file system @@ -1684,7 +1687,7 @@ ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum)); functions above that do not distinguish those cases in their return values. */ -ZEXTERN void ZEXPORT gzclearerr OF((gzFile file)); +ZEXTERN void ZEXPORT gzclearerr(gzFile file); /* Clear the error and end-of-file flags for file. This is analogous to the clearerr() function in stdio. This is useful for continuing to read a gzip @@ -1701,7 +1704,7 @@ ZEXTERN void ZEXPORT gzclearerr OF((gzFile file)); library. */ -ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); +ZEXTERN uLong ZEXPORT adler32(uLong adler, const Bytef *buf, uInt len); /* Update a running Adler-32 checksum with the bytes buf[0..len-1] and return the updated checksum. An Adler-32 value is in the range of a 32-bit @@ -1721,15 +1724,15 @@ ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); if (adler != original_adler) error(); */ -ZEXTERN uLong ZEXPORT adler32_z OF((uLong adler, const Bytef *buf, - z_size_t len)); +ZEXTERN uLong ZEXPORT adler32_z(uLong adler, const Bytef *buf, + z_size_t len); /* Same as adler32(), but with a size_t length. */ /* -ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2, - z_off_t len2)); +ZEXTERN uLong ZEXPORT adler32_combine(uLong adler1, uLong adler2, + z_off_t len2); Combine two Adler-32 checksums into one. For two sequences of bytes, seq1 and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for @@ -1739,7 +1742,7 @@ ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2, negative, the result has no meaning or utility. */ -ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); +ZEXTERN uLong ZEXPORT crc32(uLong crc, const Bytef *buf, uInt len); /* Update a running CRC-32 with the bytes buf[0..len-1] and return the updated CRC-32. A CRC-32 value is in the range of a 32-bit unsigned integer. @@ -1757,14 +1760,14 @@ ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); if (crc != original_crc) error(); */ -ZEXTERN uLong ZEXPORT crc32_z OF((uLong crc, const Bytef *buf, - z_size_t len)); +ZEXTERN uLong ZEXPORT crc32_z(uLong crc, const Bytef *buf, + z_size_t len); /* Same as crc32(), but with a size_t length. */ /* -ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2)); +ZEXTERN uLong ZEXPORT crc32_combine(uLong crc1, uLong crc2, z_off_t len2); Combine two CRC-32 check values into one. For two sequences of bytes, seq1 and seq2 with lengths len1 and len2, CRC-32 check values were @@ -1774,7 +1777,7 @@ ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2)); */ /* -ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t len2)); +ZEXTERN uLong ZEXPORT crc32_combine_gen(z_off_t len2); Return the operator corresponding to length len2, to be used with crc32_combine_op(). @@ -1782,7 +1785,7 @@ ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t len2)); #ifndef Z_FREETYPE -ZEXTERN uLong ZEXPORT crc32_combine_op OF((uLong crc1, uLong crc2, uLong op)); +ZEXTERN uLong ZEXPORT crc32_combine_op(uLong crc1, uLong crc2, uLong op); /* Give the same result as crc32_combine(), using op in place of len2. op is is generated from len2 by crc32_combine_gen(). This will be faster than @@ -1795,20 +1798,20 @@ ZEXTERN uLong ZEXPORT crc32_combine_op OF((uLong crc1, uLong crc2, uLong op)); /* deflateInit and inflateInit are macros to allow checking the zlib version * and the compiler's view of z_stream: */ -ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level, - const char *version, int stream_size)); -ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm, - const char *version, int stream_size)); -ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method, - int windowBits, int memLevel, - int strategy, const char *version, - int stream_size)); -ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits, - const char *version, int stream_size)); -ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits, - unsigned char FAR *window, - const char *version, - int stream_size)); +ZEXTERN int ZEXPORT deflateInit_(z_streamp strm, int level, + const char *version, int stream_size); +ZEXTERN int ZEXPORT inflateInit_(z_streamp strm, + const char *version, int stream_size); +ZEXTERN int ZEXPORT deflateInit2_(z_streamp strm, int level, int method, + int windowBits, int memLevel, + int strategy, const char *version, + int stream_size); +ZEXTERN int ZEXPORT inflateInit2_(z_streamp strm, int windowBits, + const char *version, int stream_size); +ZEXTERN int ZEXPORT inflateBackInit_(z_streamp strm, int windowBits, + unsigned char FAR *window, + const char *version, + int stream_size); #ifdef Z_PREFIX_SET # define z_deflateInit(strm, level) \ deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream)) @@ -1841,9 +1844,8 @@ ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits, #else /* Z_FREETYPE */ - -ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits, - const char *version, int stream_size)); +ZEXTERN int ZEXPORT inflateInit2_(z_streamp strm, int windowBits, + const char *version, int stream_size); # define inflateInit2(strm, windowBits) \ inflateInit2_((strm), (windowBits), ZLIB_VERSION, \ @@ -1851,7 +1853,6 @@ ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits, #endif /* Z_FREETYPE */ - #ifndef Z_SOLO /* gzgetc() macro and its supporting function and exposed data structure. Note @@ -1866,7 +1867,7 @@ struct gzFile_s { unsigned char *next; z_off64_t pos; }; -ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */ +ZEXTERN int ZEXPORT gzgetc_(gzFile file); /* backward compatibility */ #ifdef Z_PREFIX_SET # undef z_gzgetc # define z_gzgetc(g) \ @@ -1883,13 +1884,13 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */ * without large file support, _LFS64_LARGEFILE must also be true */ #ifdef Z_LARGE64 - ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); - ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int)); - ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile)); - ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile)); - ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t)); - ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t)); - ZEXTERN uLong ZEXPORT crc32_combine_gen64 OF((z_off64_t)); + ZEXTERN gzFile ZEXPORT gzopen64(const char *, const char *); + ZEXTERN z_off64_t ZEXPORT gzseek64(gzFile, z_off64_t, int); + ZEXTERN z_off64_t ZEXPORT gztell64(gzFile); + ZEXTERN z_off64_t ZEXPORT gzoffset64(gzFile); + ZEXTERN uLong ZEXPORT adler32_combine64(uLong, uLong, z_off64_t); + ZEXTERN uLong ZEXPORT crc32_combine64(uLong, uLong, z_off64_t); + ZEXTERN uLong ZEXPORT crc32_combine_gen64(z_off64_t); #endif #if !defined(ZLIB_INTERNAL) && defined(Z_WANT64) @@ -1911,55 +1912,55 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */ # define crc32_combine_gen crc32_combine_gen64 # endif # ifndef Z_LARGE64 - ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); - ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int)); - ZEXTERN z_off_t ZEXPORT gztell64 OF((gzFile)); - ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile)); - ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t)); - ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t)); - ZEXTERN uLong ZEXPORT crc32_combine_gen64 OF((z_off_t)); + ZEXTERN gzFile ZEXPORT gzopen64(const char *, const char *); + ZEXTERN z_off_t ZEXPORT gzseek64(gzFile, z_off_t, int); + ZEXTERN z_off_t ZEXPORT gztell64(gzFile); + ZEXTERN z_off_t ZEXPORT gzoffset64(gzFile); + ZEXTERN uLong ZEXPORT adler32_combine64(uLong, uLong, z_off_t); + ZEXTERN uLong ZEXPORT crc32_combine64(uLong, uLong, z_off_t); + ZEXTERN uLong ZEXPORT crc32_combine_gen64(z_off_t); # endif #else - ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *)); - ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile, z_off_t, int)); - ZEXTERN z_off_t ZEXPORT gztell OF((gzFile)); - ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile)); - ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t)); - ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t)); - ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t)); + ZEXTERN gzFile ZEXPORT gzopen(const char *, const char *); + ZEXTERN z_off_t ZEXPORT gzseek(gzFile, z_off_t, int); + ZEXTERN z_off_t ZEXPORT gztell(gzFile); + ZEXTERN z_off_t ZEXPORT gzoffset(gzFile); + ZEXTERN uLong ZEXPORT adler32_combine(uLong, uLong, z_off_t); + ZEXTERN uLong ZEXPORT crc32_combine(uLong, uLong, z_off_t); + ZEXTERN uLong ZEXPORT crc32_combine_gen(z_off_t); #endif #else /* Z_SOLO */ #ifndef Z_FREETYPE - ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t)); - ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t)); - ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t)); + ZEXTERN uLong ZEXPORT adler32_combine(uLong, uLong, z_off_t); + ZEXTERN uLong ZEXPORT crc32_combine(uLong, uLong, z_off_t); + ZEXTERN uLong ZEXPORT crc32_combine_gen(z_off_t); #endif #endif /* !Z_SOLO */ /* undocumented functions */ #ifndef Z_FREETYPE -ZEXTERN const char * ZEXPORT zError OF((int)); -ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp)); -ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table OF((void)); -ZEXTERN int ZEXPORT inflateUndermine OF((z_streamp, int)); -ZEXTERN int ZEXPORT inflateValidate OF((z_streamp, int)); -ZEXTERN unsigned long ZEXPORT inflateCodesUsed OF((z_streamp)); +ZEXTERN const char * ZEXPORT zError(int); +ZEXTERN int ZEXPORT inflateSyncPoint(z_streamp); +ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table(void); +ZEXTERN int ZEXPORT inflateUndermine(z_streamp, int); +ZEXTERN int ZEXPORT inflateValidate(z_streamp, int); +ZEXTERN unsigned long ZEXPORT inflateCodesUsed(z_streamp); #endif /* !Z_FREETYPE */ -ZEXTERN int ZEXPORT inflateResetKeep OF((z_streamp)); +ZEXTERN int ZEXPORT inflateResetKeep(z_streamp); #ifndef Z_FREETYPE -ZEXTERN int ZEXPORT deflateResetKeep OF((z_streamp)); +ZEXTERN int ZEXPORT deflateResetKeep(z_streamp); #if defined(_WIN32) && !defined(Z_SOLO) -ZEXTERN gzFile ZEXPORT gzopen_w OF((const wchar_t *path, - const char *mode)); +ZEXTERN gzFile ZEXPORT gzopen_w(const wchar_t *path, + const char *mode); #endif #if defined(STDC) || defined(Z_HAVE_STDARG_H) # ifndef Z_SOLO -ZEXTERN int ZEXPORTVA gzvprintf Z_ARG((gzFile file, - const char *format, - va_list va)); +ZEXTERN int ZEXPORTVA gzvprintf(gzFile file, + const char *format, + va_list va); # endif #endif #endif /* !Z_FREETYPE */ diff --git a/vendor/freetype/src/gzip/zutil.c b/vendor/freetype/src/gzip/zutil.c index 542706ca0c..f76def425c 100644 --- a/vendor/freetype/src/gzip/zutil.c +++ b/vendor/freetype/src/gzip/zutil.c @@ -26,13 +26,11 @@ z_const char * const z_errmsg[10] = { }; -const char * ZEXPORT zlibVersion() -{ +const char * ZEXPORT zlibVersion(void) { return ZLIB_VERSION; } -uLong ZEXPORT zlibCompileFlags() -{ +uLong ZEXPORT zlibCompileFlags(void) { uLong flags; flags = 0; @@ -123,9 +121,7 @@ uLong ZEXPORT zlibCompileFlags() # endif int ZLIB_INTERNAL z_verbose = verbose; -void ZLIB_INTERNAL z_error( - char *m) -{ +void ZLIB_INTERNAL z_error(char *m) { fprintf(stderr, "%s\n", m); exit(1); } @@ -134,9 +130,7 @@ void ZLIB_INTERNAL z_error( /* exported to allow conversion of error code to string for compress() and * uncompress() */ -const char * ZEXPORT zError( - int err) -{ +const char * ZEXPORT zError(int err) { return ERR_MSG(err); } @@ -152,11 +146,7 @@ const char * ZEXPORT zError( #ifndef HAVE_MEMCPY -void ZLIB_INTERNAL zmemcpy( - Bytef* dest, - const Bytef* source, - uInt len) -{ +void ZLIB_INTERNAL zmemcpy(Bytef* dest, const Bytef* source, uInt len) { if (len == 0) return; do { *dest++ = *source++; /* ??? to be unrolled */ @@ -164,12 +154,7 @@ void ZLIB_INTERNAL zmemcpy( } #ifndef Z_FREETYPE - -int ZLIB_INTERNAL zmemcmp( - const Bytef* s1, - const Bytef* s2, - uInt len) -{ +int ZLIB_INTERNAL zmemcmp(const Bytef* s1, const Bytef* s2, uInt len) { uInt j; for (j = 0; j < len; j++) { @@ -178,10 +163,7 @@ int ZLIB_INTERNAL zmemcmp( return 0; } -void ZLIB_INTERNAL zmemzero( - Bytef* dest, - uInt len) -{ +void ZLIB_INTERNAL zmemzero(Bytef* dest, uInt len) { if (len == 0) return; do { *dest++ = 0; /* ??? to be unrolled */ @@ -223,8 +205,7 @@ local ptr_table table[MAX_PTR]; * a protected system like OS/2. Use Microsoft C instead. */ -voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, unsigned items, unsigned size) -{ +voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, unsigned items, unsigned size) { voidpf buf; ulg bsize = (ulg)items*size; @@ -249,8 +230,7 @@ voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, unsigned items, unsigned size) return buf; } -void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr) -{ +void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr) { int n; (void)opaque; @@ -286,14 +266,12 @@ void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr) # define _hfree hfree #endif -voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, uInt items, uInt size) -{ +voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, uInt items, uInt size) { (void)opaque; return _halloc((long)items, size); } -void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr) -{ +void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr) { (void)opaque; _hfree(ptr); } @@ -306,25 +284,18 @@ void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr) #ifndef MY_ZCALLOC /* Any system without a special alloc function */ #ifndef STDC -extern voidp malloc OF((uInt size)); -extern voidp calloc OF((uInt items, uInt size)); -extern void free OF((voidpf ptr)); +extern voidp malloc(uInt size); +extern voidp calloc(uInt items, uInt size); +extern void free(voidpf ptr); #endif -voidpf ZLIB_INTERNAL zcalloc( - voidpf opaque, - unsigned items, - unsigned size) -{ +voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, unsigned items, unsigned size) { (void)opaque; return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) : (voidpf)calloc(items, size); } -void ZLIB_INTERNAL zcfree( - voidpf opaque, - voidpf ptr) -{ +void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr) { (void)opaque; free(ptr); } diff --git a/vendor/freetype/src/gzip/zutil.h b/vendor/freetype/src/gzip/zutil.h index 055ba8b62f..a2c046a1f0 100644 --- a/vendor/freetype/src/gzip/zutil.h +++ b/vendor/freetype/src/gzip/zutil.h @@ -56,7 +56,7 @@ typedef unsigned long ulg; #ifndef Z_FREETYPE extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ /* (size given to avoid silly warnings with Visual C++) */ -#endif /* !Z_FREETYPE */ +#endif #define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)] @@ -195,9 +195,9 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ /* provide prototypes for these when building zlib without LFS */ #if !defined(_WIN32) && \ (!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0) - ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t)); - ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t)); - ZEXTERN uLong ZEXPORT crc32_combine_gen64 OF((z_off_t)); + ZEXTERN uLong ZEXPORT adler32_combine64(uLong, uLong, z_off_t); + ZEXTERN uLong ZEXPORT crc32_combine64(uLong, uLong, z_off_t); + ZEXTERN uLong ZEXPORT crc32_combine_gen64(z_off_t); #endif #endif /* !Z_FREETYPE */ @@ -238,16 +238,16 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ # define zmemzero(dest, len) ft_memset(dest, 0, len) # endif #else - void ZLIB_INTERNAL zmemcpy OF((Bytef* dest, const Bytef* source, uInt len)); - int ZLIB_INTERNAL zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len)); - void ZLIB_INTERNAL zmemzero OF((Bytef* dest, uInt len)); + void ZLIB_INTERNAL zmemcpy(Bytef* dest, const Bytef* source, uInt len); + int ZLIB_INTERNAL zmemcmp(const Bytef* s1, const Bytef* s2, uInt len); + void ZLIB_INTERNAL zmemzero(Bytef* dest, uInt len); #endif /* Diagnostic functions */ #ifdef ZLIB_DEBUG # include extern int ZLIB_INTERNAL z_verbose; - extern void ZLIB_INTERNAL z_error OF((char *m)); + extern void ZLIB_INTERNAL z_error(char *m); # define Assert(cond,msg) {if(!(cond)) z_error(msg);} # define Trace(x) {if (z_verbose>=0) fprintf x ;} # define Tracev(x) {if (z_verbose>0) fprintf x ;} @@ -264,9 +264,9 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ #endif #ifndef Z_SOLO - voidpf ZLIB_INTERNAL zcalloc OF((voidpf opaque, unsigned items, - unsigned size)); - void ZLIB_INTERNAL zcfree OF((voidpf opaque, voidpf ptr)); + voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, unsigned items, + unsigned size); + void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr); #endif #define ZALLOC(strm, items, size) \ diff --git a/vendor/freetype/src/lzw/ftlzw.c b/vendor/freetype/src/lzw/ftlzw.c index 88383792a8..e1acf22eee 100644 --- a/vendor/freetype/src/lzw/ftlzw.c +++ b/vendor/freetype/src/lzw/ftlzw.c @@ -8,7 +8,7 @@ * be used to parse compressed PCF fonts, as found with many X11 server * distributions. * - * Copyright (C) 2004-2023 by + * Copyright (C) 2004-2024 by * Albert Chin-A-Young. * * based on code in `src/gzip/ftgzip.c' diff --git a/vendor/freetype/src/lzw/ftzopen.c b/vendor/freetype/src/lzw/ftzopen.c index e680c4de59..e42332466f 100644 --- a/vendor/freetype/src/lzw/ftzopen.c +++ b/vendor/freetype/src/lzw/ftzopen.c @@ -8,7 +8,7 @@ * be used to parse compressed PCF fonts, as found with many X11 server * distributions. * - * Copyright (C) 2005-2023 by + * Copyright (C) 2005-2024 by * David Turner. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/lzw/ftzopen.h b/vendor/freetype/src/lzw/ftzopen.h index 6c7563643f..6915218292 100644 --- a/vendor/freetype/src/lzw/ftzopen.h +++ b/vendor/freetype/src/lzw/ftzopen.h @@ -8,7 +8,7 @@ * be used to parse compressed PCF fonts, as found with many X11 server * distributions. * - * Copyright (C) 2005-2023 by + * Copyright (C) 2005-2024 by * David Turner. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/otvalid/otvalid.c b/vendor/freetype/src/otvalid/otvalid.c index 3b1e23a6f7..c96967ce65 100644 --- a/vendor/freetype/src/otvalid/otvalid.c +++ b/vendor/freetype/src/otvalid/otvalid.c @@ -4,7 +4,7 @@ * * FreeType validator for OpenType tables (body only). * - * Copyright (C) 2004-2023 by + * Copyright (C) 2004-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/otvalid/otvalid.h b/vendor/freetype/src/otvalid/otvalid.h index 7edadb771b..0f46a7a1f5 100644 --- a/vendor/freetype/src/otvalid/otvalid.h +++ b/vendor/freetype/src/otvalid/otvalid.h @@ -4,7 +4,7 @@ * * OpenType table validation (specification only). * - * Copyright (C) 2004-2023 by + * Copyright (C) 2004-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/otvalid/otvbase.c b/vendor/freetype/src/otvalid/otvbase.c index f449795f89..610126242a 100644 --- a/vendor/freetype/src/otvalid/otvbase.c +++ b/vendor/freetype/src/otvalid/otvbase.c @@ -4,7 +4,7 @@ * * OpenType BASE table validation (body). * - * Copyright (C) 2004-2023 by + * Copyright (C) 2004-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/otvalid/otvcommn.c b/vendor/freetype/src/otvalid/otvcommn.c index b94d8a0651..f06354b781 100644 --- a/vendor/freetype/src/otvalid/otvcommn.c +++ b/vendor/freetype/src/otvalid/otvcommn.c @@ -4,7 +4,7 @@ * * OpenType common tables validation (body). * - * Copyright (C) 2004-2023 by + * Copyright (C) 2004-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/otvalid/otvcommn.h b/vendor/freetype/src/otvalid/otvcommn.h index 6702c00085..7db1a575d9 100644 --- a/vendor/freetype/src/otvalid/otvcommn.h +++ b/vendor/freetype/src/otvalid/otvcommn.h @@ -4,7 +4,7 @@ * * OpenType common tables validation (specification). * - * Copyright (C) 2004-2023 by + * Copyright (C) 2004-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/otvalid/otverror.h b/vendor/freetype/src/otvalid/otverror.h index 4c4049ca5b..7f4dd6eb63 100644 --- a/vendor/freetype/src/otvalid/otverror.h +++ b/vendor/freetype/src/otvalid/otverror.h @@ -4,7 +4,7 @@ * * OpenType validation module error codes (specification only). * - * Copyright (C) 2004-2023 by + * Copyright (C) 2004-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/otvalid/otvgdef.c b/vendor/freetype/src/otvalid/otvgdef.c index d62e8187f6..e36cda754e 100644 --- a/vendor/freetype/src/otvalid/otvgdef.c +++ b/vendor/freetype/src/otvalid/otvgdef.c @@ -4,7 +4,7 @@ * * OpenType GDEF table validation (body). * - * Copyright (C) 2004-2023 by + * Copyright (C) 2004-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/otvalid/otvgpos.c b/vendor/freetype/src/otvalid/otvgpos.c index f6102afbce..d7547a33ef 100644 --- a/vendor/freetype/src/otvalid/otvgpos.c +++ b/vendor/freetype/src/otvalid/otvgpos.c @@ -4,7 +4,7 @@ * * OpenType GPOS table validation (body). * - * Copyright (C) 2002-2023 by + * Copyright (C) 2002-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/otvalid/otvgpos.h b/vendor/freetype/src/otvalid/otvgpos.h index b5d0f54850..48a9ed0f02 100644 --- a/vendor/freetype/src/otvalid/otvgpos.h +++ b/vendor/freetype/src/otvalid/otvgpos.h @@ -4,7 +4,7 @@ * * OpenType GPOS table validator (specification). * - * Copyright (C) 2004-2023 by + * Copyright (C) 2004-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/otvalid/otvgsub.c b/vendor/freetype/src/otvalid/otvgsub.c index 5d40d9243d..a479101b15 100644 --- a/vendor/freetype/src/otvalid/otvgsub.c +++ b/vendor/freetype/src/otvalid/otvgsub.c @@ -4,7 +4,7 @@ * * OpenType GSUB table validation (body). * - * Copyright (C) 2004-2023 by + * Copyright (C) 2004-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/otvalid/otvjstf.c b/vendor/freetype/src/otvalid/otvjstf.c index 712039c661..1309f6d906 100644 --- a/vendor/freetype/src/otvalid/otvjstf.c +++ b/vendor/freetype/src/otvalid/otvjstf.c @@ -4,7 +4,7 @@ * * OpenType JSTF table validation (body). * - * Copyright (C) 2004-2023 by + * Copyright (C) 2004-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/otvalid/otvmath.c b/vendor/freetype/src/otvalid/otvmath.c index 01fd863c97..b84845a72b 100644 --- a/vendor/freetype/src/otvalid/otvmath.c +++ b/vendor/freetype/src/otvalid/otvmath.c @@ -4,7 +4,7 @@ * * OpenType MATH table validation (body). * - * Copyright (C) 2007-2023 by + * Copyright (C) 2007-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * Written by George Williams. diff --git a/vendor/freetype/src/otvalid/otvmod.c b/vendor/freetype/src/otvalid/otvmod.c index d6057c5a47..74e50c787d 100644 --- a/vendor/freetype/src/otvalid/otvmod.c +++ b/vendor/freetype/src/otvalid/otvmod.c @@ -4,7 +4,7 @@ * * FreeType's OpenType validation module implementation (body). * - * Copyright (C) 2004-2023 by + * Copyright (C) 2004-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/otvalid/otvmod.h b/vendor/freetype/src/otvalid/otvmod.h index f0e68dbc08..245c78020c 100644 --- a/vendor/freetype/src/otvalid/otvmod.h +++ b/vendor/freetype/src/otvalid/otvmod.h @@ -5,7 +5,7 @@ * FreeType's OpenType validation module implementation * (specification). * - * Copyright (C) 2004-2023 by + * Copyright (C) 2004-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/pcf/pcfutil.c b/vendor/freetype/src/pcf/pcfutil.c index 9575726916..cd26c77cad 100644 --- a/vendor/freetype/src/pcf/pcfutil.c +++ b/vendor/freetype/src/pcf/pcfutil.c @@ -57,7 +57,7 @@ in this Software without prior written authorization from The Open Group. } -#if defined( __clang__ ) || \ +#if ( defined( __clang_major__ ) && __clang_major__ >= 5 ) || \ ( defined( __GNUC__ ) && \ ( __GNUC__ > 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ >= 8 ) ) ) diff --git a/vendor/freetype/src/pfr/pfr.c b/vendor/freetype/src/pfr/pfr.c index d3738152dc..71b57930b3 100644 --- a/vendor/freetype/src/pfr/pfr.c +++ b/vendor/freetype/src/pfr/pfr.c @@ -4,7 +4,7 @@ * * FreeType PFR driver component. * - * Copyright (C) 2002-2023 by + * Copyright (C) 2002-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/pfr/pfrcmap.c b/vendor/freetype/src/pfr/pfrcmap.c index 08fe41d54e..cd701661f1 100644 --- a/vendor/freetype/src/pfr/pfrcmap.c +++ b/vendor/freetype/src/pfr/pfrcmap.c @@ -4,7 +4,7 @@ * * FreeType PFR cmap handling (body). * - * Copyright (C) 2002-2023 by + * Copyright (C) 2002-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/pfr/pfrcmap.h b/vendor/freetype/src/pfr/pfrcmap.h index 8110f175e8..ab7913575d 100644 --- a/vendor/freetype/src/pfr/pfrcmap.h +++ b/vendor/freetype/src/pfr/pfrcmap.h @@ -4,7 +4,7 @@ * * FreeType PFR cmap handling (specification). * - * Copyright (C) 2002-2023 by + * Copyright (C) 2002-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/pfr/pfrdrivr.c b/vendor/freetype/src/pfr/pfrdrivr.c index 0048f52411..ffd822273f 100644 --- a/vendor/freetype/src/pfr/pfrdrivr.c +++ b/vendor/freetype/src/pfr/pfrdrivr.c @@ -4,7 +4,7 @@ * * FreeType PFR driver interface (body). * - * Copyright (C) 2002-2023 by + * Copyright (C) 2002-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/pfr/pfrdrivr.h b/vendor/freetype/src/pfr/pfrdrivr.h index da14468d42..58954a9af0 100644 --- a/vendor/freetype/src/pfr/pfrdrivr.h +++ b/vendor/freetype/src/pfr/pfrdrivr.h @@ -4,7 +4,7 @@ * * High-level Type PFR driver interface (specification). * - * Copyright (C) 2002-2023 by + * Copyright (C) 2002-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/pfr/pfrerror.h b/vendor/freetype/src/pfr/pfrerror.h index 5dfb254d66..af0ddaf184 100644 --- a/vendor/freetype/src/pfr/pfrerror.h +++ b/vendor/freetype/src/pfr/pfrerror.h @@ -4,7 +4,7 @@ * * PFR error codes (specification only). * - * Copyright (C) 2002-2023 by + * Copyright (C) 2002-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/pfr/pfrgload.c b/vendor/freetype/src/pfr/pfrgload.c index 48cf27ec80..e850075527 100644 --- a/vendor/freetype/src/pfr/pfrgload.c +++ b/vendor/freetype/src/pfr/pfrgload.c @@ -4,7 +4,7 @@ * * FreeType PFR glyph loader (body). * - * Copyright (C) 2002-2023 by + * Copyright (C) 2002-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -108,7 +108,7 @@ /* don't add empty contours */ if ( last >= first ) - outline->contours[outline->n_contours++] = (short)last; + outline->contours[outline->n_contours++] = (FT_UShort)last; glyph->path_begun = 0; } @@ -178,8 +178,8 @@ error = FT_GLYPHLOADER_CHECK_POINTS( loader, 3, 0 ); if ( !error ) { - FT_Vector* vec = outline->points + outline->n_points; - FT_Byte* tag = (FT_Byte*)outline->tags + outline->n_points; + FT_Vector* vec = outline->points + outline->n_points; + FT_Byte* tag = outline->tags + outline->n_points; vec[0] = *control1; @@ -189,7 +189,7 @@ tag[1] = FT_CURVE_TAG_CUBIC; tag[2] = FT_CURVE_TAG_ON; - outline->n_points = (FT_Short)( outline->n_points + 3 ); + outline->n_points += 3; } Exit: diff --git a/vendor/freetype/src/pfr/pfrgload.h b/vendor/freetype/src/pfr/pfrgload.h index 92a59bc5db..d86549fbe4 100644 --- a/vendor/freetype/src/pfr/pfrgload.h +++ b/vendor/freetype/src/pfr/pfrgload.h @@ -4,7 +4,7 @@ * * FreeType PFR glyph loader (specification). * - * Copyright (C) 2002-2023 by + * Copyright (C) 2002-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/pfr/pfrload.c b/vendor/freetype/src/pfr/pfrload.c index 856a5942f5..358af5c78a 100644 --- a/vendor/freetype/src/pfr/pfrload.c +++ b/vendor/freetype/src/pfr/pfrload.c @@ -4,7 +4,7 @@ * * FreeType PFR loader (body). * - * Copyright (C) 2002-2023 by + * Copyright (C) 2002-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/pfr/pfrload.h b/vendor/freetype/src/pfr/pfrload.h index d7b20a4572..7390296d4a 100644 --- a/vendor/freetype/src/pfr/pfrload.h +++ b/vendor/freetype/src/pfr/pfrload.h @@ -4,7 +4,7 @@ * * FreeType PFR loader (specification). * - * Copyright (C) 2002-2023 by + * Copyright (C) 2002-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/pfr/pfrobjs.c b/vendor/freetype/src/pfr/pfrobjs.c index 8ef17c6636..084d2ef5a1 100644 --- a/vendor/freetype/src/pfr/pfrobjs.c +++ b/vendor/freetype/src/pfr/pfrobjs.c @@ -4,7 +4,7 @@ * * FreeType PFR object methods (body). * - * Copyright (C) 2002-2023 by + * Copyright (C) 2002-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/pfr/pfrobjs.h b/vendor/freetype/src/pfr/pfrobjs.h index fcf8c38122..1b548a1bc2 100644 --- a/vendor/freetype/src/pfr/pfrobjs.h +++ b/vendor/freetype/src/pfr/pfrobjs.h @@ -4,7 +4,7 @@ * * FreeType PFR object methods (specification). * - * Copyright (C) 2002-2023 by + * Copyright (C) 2002-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/pfr/pfrsbit.c b/vendor/freetype/src/pfr/pfrsbit.c index 46a988e8e3..96cc7fecec 100644 --- a/vendor/freetype/src/pfr/pfrsbit.c +++ b/vendor/freetype/src/pfr/pfrsbit.c @@ -4,7 +4,7 @@ * * FreeType PFR bitmap loader (body). * - * Copyright (C) 2002-2023 by + * Copyright (C) 2002-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/pfr/pfrsbit.h b/vendor/freetype/src/pfr/pfrsbit.h index 3e1dba9ae9..105a2991c2 100644 --- a/vendor/freetype/src/pfr/pfrsbit.h +++ b/vendor/freetype/src/pfr/pfrsbit.h @@ -4,7 +4,7 @@ * * FreeType PFR bitmap loader (specification). * - * Copyright (C) 2002-2023 by + * Copyright (C) 2002-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/pfr/pfrtypes.h b/vendor/freetype/src/pfr/pfrtypes.h index 2f8909f062..435a77c8f2 100644 --- a/vendor/freetype/src/pfr/pfrtypes.h +++ b/vendor/freetype/src/pfr/pfrtypes.h @@ -4,7 +4,7 @@ * * FreeType PFR data structures (specification only). * - * Copyright (C) 2002-2023 by + * Copyright (C) 2002-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/psaux/afmparse.c b/vendor/freetype/src/psaux/afmparse.c index db08941def..e2f6a8e5ad 100644 --- a/vendor/freetype/src/psaux/afmparse.c +++ b/vendor/freetype/src/psaux/afmparse.c @@ -4,7 +4,7 @@ * * AFM parser (body). * - * Copyright (C) 2006-2023 by + * Copyright (C) 2006-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/psaux/afmparse.h b/vendor/freetype/src/psaux/afmparse.h index 2d3b6e6e16..b776637282 100644 --- a/vendor/freetype/src/psaux/afmparse.h +++ b/vendor/freetype/src/psaux/afmparse.h @@ -4,7 +4,7 @@ * * AFM parser (specification). * - * Copyright (C) 2006-2023 by + * Copyright (C) 2006-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/psaux/cffdecode.c b/vendor/freetype/src/psaux/cffdecode.c index 562d17d221..9556e11a58 100644 --- a/vendor/freetype/src/psaux/cffdecode.c +++ b/vendor/freetype/src/psaux/cffdecode.c @@ -4,7 +4,7 @@ * * PostScript CFF (Type 2) decoding routines (body). * - * Copyright (C) 2017-2023 by + * Copyright (C) 2017-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -17,6 +17,7 @@ #include +#include #include #include #include @@ -1752,22 +1753,9 @@ /* without upper limit the loop below might not finish */ if ( args[0] > 0x7FFFFFFFL ) - args[0] = 46341; + args[0] = 0xB504F4L; /* sqrt( 32768.0044 ) */ else if ( args[0] > 0 ) - { - FT_Fixed root = args[0]; - FT_Fixed new_root; - - - for (;;) - { - new_root = ( root + FT_DivFix( args[0], root ) + 1 ) >> 1; - if ( new_root == root ) - break; - root = new_root; - } - args[0] = new_root; - } + args[0] = (FT_Fixed)FT_SqrtFixed( args[0] ); else args[0] = 0; args++; diff --git a/vendor/freetype/src/psaux/cffdecode.h b/vendor/freetype/src/psaux/cffdecode.h index e8bb4001cb..038f7235c3 100644 --- a/vendor/freetype/src/psaux/cffdecode.h +++ b/vendor/freetype/src/psaux/cffdecode.h @@ -4,7 +4,7 @@ * * PostScript CFF (Type 2) decoding routines (specification). * - * Copyright (C) 2017-2023 by + * Copyright (C) 2017-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/psaux/psaux.c b/vendor/freetype/src/psaux/psaux.c index 5879ed1635..ffe89cd624 100644 --- a/vendor/freetype/src/psaux/psaux.c +++ b/vendor/freetype/src/psaux/psaux.c @@ -4,7 +4,7 @@ * * FreeType auxiliary PostScript driver component (body only). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/psaux/psauxerr.h b/vendor/freetype/src/psaux/psauxerr.h index 895ffa48c2..18428c40d5 100644 --- a/vendor/freetype/src/psaux/psauxerr.h +++ b/vendor/freetype/src/psaux/psauxerr.h @@ -4,7 +4,7 @@ * * PS auxiliary module error codes (specification only). * - * Copyright (C) 2001-2023 by + * Copyright (C) 2001-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/psaux/psauxmod.c b/vendor/freetype/src/psaux/psauxmod.c index 45e35aa53c..6826f9d8d3 100644 --- a/vendor/freetype/src/psaux/psauxmod.c +++ b/vendor/freetype/src/psaux/psauxmod.c @@ -4,7 +4,7 @@ * * FreeType auxiliary PostScript module implementation (body). * - * Copyright (C) 2000-2023 by + * Copyright (C) 2000-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/psaux/psauxmod.h b/vendor/freetype/src/psaux/psauxmod.h index 94dbf48813..82d7e348af 100644 --- a/vendor/freetype/src/psaux/psauxmod.h +++ b/vendor/freetype/src/psaux/psauxmod.h @@ -4,7 +4,7 @@ * * FreeType auxiliary PostScript module implementation (specification). * - * Copyright (C) 2000-2023 by + * Copyright (C) 2000-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/psaux/psblues.c b/vendor/freetype/src/psaux/psblues.c index f9c864fea9..213b943b46 100644 --- a/vendor/freetype/src/psaux/psblues.c +++ b/vendor/freetype/src/psaux/psblues.c @@ -54,14 +54,6 @@ #define FT_COMPONENT cf2blues - /* - * For blue values, the FreeType parser produces an array of integers, - * while the Adobe CFF engine produces an array of fixed. - * Define a macro to convert FreeType to fixed. - */ -#define cf2_blueToFixed( x ) cf2_intToFixed( x ) - - FT_LOCAL_DEF( void ) cf2_blues_init( CF2_Blues blues, CF2_Font font ) @@ -78,10 +70,10 @@ size_t numFamilyBlues; size_t numFamilyOtherBlues; - FT_Pos* blueValues; - FT_Pos* otherBlues; - FT_Pos* familyBlues; - FT_Pos* familyOtherBlues; + FT_Fixed* blueValues; + FT_Fixed* otherBlues; + FT_Fixed* familyBlues; + FT_Fixed* familyOtherBlues; size_t i; CF2_Fixed emBoxBottom, emBoxTop; @@ -138,13 +130,13 @@ emBoxTop = CF2_ICF_Top; } - if ( cf2_getLanguageGroup( decoder ) == 1 && - ( numBlueValues == 0 || - ( numBlueValues == 4 && - cf2_blueToFixed( blueValues[0] ) < emBoxBottom && - cf2_blueToFixed( blueValues[1] ) < emBoxBottom && - cf2_blueToFixed( blueValues[2] ) > emBoxTop && - cf2_blueToFixed( blueValues[3] ) > emBoxTop ) ) ) + if ( cf2_getLanguageGroup( decoder ) == 1 && + ( numBlueValues == 0 || + ( numBlueValues == 4 && + blueValues[0] < emBoxBottom && + blueValues[1] < emBoxBottom && + blueValues[2] > emBoxTop && + blueValues[3] > emBoxTop ) ) ) { /* * Construct hint edges suitable for synthetic ghost hints at top @@ -189,10 +181,8 @@ /* bottom zones */ for ( i = 0; i < numBlueValues; i += 2 ) { - blues->zone[blues->count].csBottomEdge = - cf2_blueToFixed( blueValues[i] ); - blues->zone[blues->count].csTopEdge = - cf2_blueToFixed( blueValues[i + 1] ); + blues->zone[blues->count].csBottomEdge = blueValues[i]; + blues->zone[blues->count].csTopEdge = blueValues[i + 1]; zoneHeight = SUB_INT32( blues->zone[blues->count].csTopEdge, blues->zone[blues->count].csBottomEdge ); @@ -238,10 +228,8 @@ for ( i = 0; i < numOtherBlues; i += 2 ) { - blues->zone[blues->count].csBottomEdge = - cf2_blueToFixed( otherBlues[i] ); - blues->zone[blues->count].csTopEdge = - cf2_blueToFixed( otherBlues[i + 1] ); + blues->zone[blues->count].csBottomEdge = otherBlues[i]; + blues->zone[blues->count].csTopEdge = otherBlues[i + 1]; zoneHeight = SUB_INT32( blues->zone[blues->count].csTopEdge, blues->zone[blues->count].csBottomEdge ); @@ -299,7 +287,7 @@ for ( j = 0; j < numFamilyOtherBlues; j += 2 ) { /* top edge */ - flatFamilyEdge = cf2_blueToFixed( familyOtherBlues[j + 1] ); + flatFamilyEdge = familyOtherBlues[j + 1]; diff = cf2_fixedAbs( SUB_INT32( flatEdge, flatFamilyEdge ) ); @@ -317,7 +305,7 @@ if ( numFamilyBlues >= 2 ) { /* top edge */ - flatFamilyEdge = cf2_blueToFixed( familyBlues[1] ); + flatFamilyEdge = familyBlues[1]; diff = cf2_fixedAbs( SUB_INT32( flatEdge, flatFamilyEdge ) ); @@ -337,7 +325,7 @@ for ( j = 2; j < numFamilyBlues; j += 2 ) { /* bottom edge */ - flatFamilyEdge = cf2_blueToFixed( familyBlues[j] ); + flatFamilyEdge = familyBlues[j]; /* adjust edges of top zone upward by twice darkening amount */ flatFamilyEdge += 2 * font->darkenY; /* bottom edge */ diff --git a/vendor/freetype/src/psaux/psconv.c b/vendor/freetype/src/psaux/psconv.c index b9c7138d84..56c0ecd1d7 100644 --- a/vendor/freetype/src/psaux/psconv.c +++ b/vendor/freetype/src/psaux/psconv.c @@ -4,7 +4,7 @@ * * Some convenience conversions (body). * - * Copyright (C) 2006-2023 by + * Copyright (C) 2006-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/psaux/psconv.h b/vendor/freetype/src/psaux/psconv.h index b7c3ee00be..91fcd15a1c 100644 --- a/vendor/freetype/src/psaux/psconv.h +++ b/vendor/freetype/src/psaux/psconv.h @@ -4,7 +4,7 @@ * * Some convenience conversions (specification). * - * Copyright (C) 2006-2023 by + * Copyright (C) 2006-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/psaux/psft.c b/vendor/freetype/src/psaux/psft.c index 618864e6e0..fd0abe1715 100644 --- a/vendor/freetype/src/psaux/psft.c +++ b/vendor/freetype/src/psaux/psft.c @@ -566,12 +566,12 @@ FT_LOCAL_DEF( void ) cf2_getBlueValues( PS_Decoder* decoder, size_t* count, - FT_Pos* *data ) + FT_Fixed* *data ) { FT_ASSERT( decoder && decoder->current_subfont ); *count = decoder->current_subfont->private_dict.num_blue_values; - *data = (FT_Pos*) + *data = (FT_Fixed*) &decoder->current_subfont->private_dict.blue_values; } @@ -579,12 +579,12 @@ FT_LOCAL_DEF( void ) cf2_getOtherBlues( PS_Decoder* decoder, size_t* count, - FT_Pos* *data ) + FT_Fixed* *data ) { FT_ASSERT( decoder && decoder->current_subfont ); *count = decoder->current_subfont->private_dict.num_other_blues; - *data = (FT_Pos*) + *data = (FT_Fixed*) &decoder->current_subfont->private_dict.other_blues; } @@ -592,12 +592,12 @@ FT_LOCAL_DEF( void ) cf2_getFamilyBlues( PS_Decoder* decoder, size_t* count, - FT_Pos* *data ) + FT_Fixed* *data ) { FT_ASSERT( decoder && decoder->current_subfont ); *count = decoder->current_subfont->private_dict.num_family_blues; - *data = (FT_Pos*) + *data = (FT_Fixed*) &decoder->current_subfont->private_dict.family_blues; } @@ -605,12 +605,12 @@ FT_LOCAL_DEF( void ) cf2_getFamilyOtherBlues( PS_Decoder* decoder, size_t* count, - FT_Pos* *data ) + FT_Fixed* *data ) { FT_ASSERT( decoder && decoder->current_subfont ); *count = decoder->current_subfont->private_dict.num_family_other_blues; - *data = (FT_Pos*) + *data = (FT_Fixed*) &decoder->current_subfont->private_dict.family_other_blues; } diff --git a/vendor/freetype/src/psaux/psft.h b/vendor/freetype/src/psaux/psft.h index 3da454e601..d9082f3a2b 100644 --- a/vendor/freetype/src/psaux/psft.h +++ b/vendor/freetype/src/psaux/psft.h @@ -92,19 +92,19 @@ FT_BEGIN_HEADER FT_LOCAL( void ) cf2_getBlueValues( PS_Decoder* decoder, size_t* count, - FT_Pos* *data ); + FT_Fixed* *data ); FT_LOCAL( void ) cf2_getOtherBlues( PS_Decoder* decoder, size_t* count, - FT_Pos* *data ); + FT_Fixed* *data ); FT_LOCAL( void ) cf2_getFamilyBlues( PS_Decoder* decoder, size_t* count, - FT_Pos* *data ); + FT_Fixed* *data ); FT_LOCAL( void ) cf2_getFamilyOtherBlues( PS_Decoder* decoder, size_t* count, - FT_Pos* *data ); + FT_Fixed* *data ); FT_LOCAL( CF2_Int ) cf2_getLanguageGroup( PS_Decoder* decoder ); diff --git a/vendor/freetype/src/psaux/psintrp.c b/vendor/freetype/src/psaux/psintrp.c index 6c640eebd5..6b445a9968 100644 --- a/vendor/freetype/src/psaux/psintrp.c +++ b/vendor/freetype/src/psaux/psintrp.c @@ -37,6 +37,7 @@ #include "psft.h" +#include #include #include @@ -428,6 +429,8 @@ base = cf2_stack_count( opStack ) - numOperands; delta = base + numBlends; + FT_TRACE6(( " (" )); + for ( i = 0; i < numBlends; i++ ) { const CF2_Fixed* weight = &blend->BV[1]; @@ -442,10 +445,14 @@ cf2_stack_getReal( opStack, delta++ ) ) ); + FT_TRACE6(( "%f ", (float) sum / 65536 )); + /* store blended result */ cf2_stack_setReal( opStack, i + base, sum ); } + FT_TRACE6(( "blended)\n" )); + /* leave only `numBlends' results on stack */ cf2_stack_pop( opStack, numOperands - numBlends ); } @@ -734,7 +741,7 @@ FT_UInt numBlends; - FT_TRACE4(( " blend\n" )); + FT_TRACE4(( " blend" )); if ( !font->isCFF2 ) break; /* clear stack & ignore */ @@ -2275,23 +2282,7 @@ arg = cf2_stack_popFixed( opStack ); if ( arg > 0 ) - { - /* use a start value that doesn't make */ - /* the algorithm's addition overflow */ - FT_Fixed root = arg < 10 ? arg : arg >> 1; - FT_Fixed new_root; - - - /* Babylonian method */ - for (;;) - { - new_root = ( root + FT_DivFix( arg, root ) + 1 ) >> 1; - if ( new_root == root ) - break; - root = new_root; - } - arg = new_root; - } + arg = (CF2_F16Dot16)FT_SqrtFixed( arg ); else arg = 0; diff --git a/vendor/freetype/src/psaux/psobjs.c b/vendor/freetype/src/psaux/psobjs.c index 8da755d0e5..eca465f009 100644 --- a/vendor/freetype/src/psaux/psobjs.c +++ b/vendor/freetype/src/psaux/psobjs.c @@ -4,7 +4,7 @@ * * Auxiliary functions for PostScript fonts (body). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -23,6 +23,7 @@ #include "psobjs.h" #include "psconv.h" +#include "psft.h" #include "psauxerr.h" #include "psauxmod.h" @@ -200,7 +201,9 @@ /* add the object to the base block and adjust offset */ table->elements[idx] = FT_OFFSET( table->block, table->cursor ); table->lengths [idx] = length; - FT_MEM_COPY( table->block + table->cursor, object, length ); + /* length == 0 also implies a NULL destination, so skip the copy call */ + if ( length > 0 ) + FT_MEM_COPY( table->block + table->cursor, object, length ); table->cursor += length; return FT_Err_Ok; @@ -1624,7 +1627,7 @@ if ( builder->load_points ) { FT_Vector* point = outline->points + outline->n_points; - FT_Byte* control = (FT_Byte*)outline->tags + outline->n_points; + FT_Byte* control = outline->tags + outline->n_points; point->x = FIXED_TO_INT( x ); @@ -1677,8 +1680,7 @@ if ( !error ) { if ( outline->n_contours > 0 ) - outline->contours[outline->n_contours - 1] = - (short)( outline->n_points - 1 ); + outline->contours[outline->n_contours - 1] = outline->n_points - 1; outline->n_contours++; } @@ -1740,7 +1742,7 @@ { FT_Vector* p1 = outline->points + first; FT_Vector* p2 = outline->points + outline->n_points - 1; - FT_Byte* control = (FT_Byte*)outline->tags + outline->n_points - 1; + FT_Byte* control = outline->tags + outline->n_points - 1; /* `delete' last point only if it coincides with the first */ @@ -1760,8 +1762,7 @@ outline->n_points--; } else - outline->contours[outline->n_contours - 1] = - (short)( outline->n_points - 1 ); + outline->contours[outline->n_contours - 1] = outline->n_points - 1; } } @@ -1899,7 +1900,7 @@ if ( builder->load_points ) { FT_Vector* point = outline->points + outline->n_points; - FT_Byte* control = (FT_Byte*)outline->tags + outline->n_points; + FT_Byte* control = outline->tags + outline->n_points; #ifdef CFF_CONFIG_OPTION_OLD_ENGINE PS_Driver driver = (PS_Driver)FT_FACE_DRIVER( builder->face ); @@ -1959,8 +1960,7 @@ if ( !error ) { if ( outline->n_contours > 0 ) - outline->contours[outline->n_contours - 1] = - (short)( outline->n_points - 1 ); + outline->contours[outline->n_contours - 1] = outline->n_points - 1; outline->n_contours++; } @@ -2019,7 +2019,7 @@ { FT_Vector* p1 = outline->points + first; FT_Vector* p2 = outline->points + outline->n_points - 1; - FT_Byte* control = (FT_Byte*)outline->tags + outline->n_points - 1; + FT_Byte* control = outline->tags + outline->n_points - 1; /* `delete' last point only if it coincides with the first */ @@ -2039,8 +2039,7 @@ outline->n_points--; } else - outline->contours[outline->n_contours - 1] = - (short)( outline->n_points - 1 ); + outline->contours[outline->n_contours - 1] = outline->n_points - 1; } } @@ -2188,7 +2187,7 @@ if ( builder->load_points ) { FT_Vector* point = outline->points + outline->n_points; - FT_Byte* control = (FT_Byte*)outline->tags + outline->n_points; + FT_Byte* control = outline->tags + outline->n_points; #ifdef CFF_CONFIG_OPTION_OLD_ENGINE PS_Driver driver = (PS_Driver)FT_FACE_DRIVER( builder->face ); @@ -2267,8 +2266,7 @@ if ( !error ) { if ( outline->n_contours > 0 ) - outline->contours[outline->n_contours - 1] = - (short)( outline->n_points - 1 ); + outline->contours[outline->n_contours - 1] = outline->n_points - 1; outline->n_contours++; } @@ -2327,7 +2325,7 @@ { FT_Vector* p1 = outline->points + first; FT_Vector* p2 = outline->points + outline->n_points - 1; - FT_Byte* control = (FT_Byte*)outline->tags + outline->n_points - 1; + FT_Byte* control = outline->tags + outline->n_points - 1; /* `delete' last point only if it coincides with the first */ @@ -2347,8 +2345,7 @@ outline->n_points--; } else - outline->contours[outline->n_contours - 1] = - (short)( outline->n_points - 1 ); + outline->contours[outline->n_contours - 1] = outline->n_points - 1; } } @@ -2463,19 +2460,20 @@ count = cpriv->num_blue_values = priv->num_blue_values; for ( n = 0; n < count; n++ ) - cpriv->blue_values[n] = (FT_Pos)priv->blue_values[n]; + cpriv->blue_values[n] = cf2_intToFixed( priv->blue_values[n] ); count = cpriv->num_other_blues = priv->num_other_blues; for ( n = 0; n < count; n++ ) - cpriv->other_blues[n] = (FT_Pos)priv->other_blues[n]; + cpriv->other_blues[n] = cf2_intToFixed( priv->other_blues[n] ); count = cpriv->num_family_blues = priv->num_family_blues; for ( n = 0; n < count; n++ ) - cpriv->family_blues[n] = (FT_Pos)priv->family_blues[n]; + cpriv->family_blues[n] = cf2_intToFixed( priv->family_blues[n] ); count = cpriv->num_family_other_blues = priv->num_family_other_blues; for ( n = 0; n < count; n++ ) - cpriv->family_other_blues[n] = (FT_Pos)priv->family_other_blues[n]; + cpriv->family_other_blues[n] = + cf2_intToFixed( priv->family_other_blues[n] ); cpriv->blue_scale = priv->blue_scale; cpriv->blue_shift = (FT_Pos)priv->blue_shift; diff --git a/vendor/freetype/src/psaux/psobjs.h b/vendor/freetype/src/psaux/psobjs.h index d5bce54108..345fc8a733 100644 --- a/vendor/freetype/src/psaux/psobjs.h +++ b/vendor/freetype/src/psaux/psobjs.h @@ -4,7 +4,7 @@ * * Auxiliary functions for PostScript fonts (specification). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/psaux/t1cmap.c b/vendor/freetype/src/psaux/t1cmap.c index c4bcf599ea..5681c3bd0f 100644 --- a/vendor/freetype/src/psaux/t1cmap.c +++ b/vendor/freetype/src/psaux/t1cmap.c @@ -4,7 +4,7 @@ * * Type 1 character map support (body). * - * Copyright (C) 2002-2023 by + * Copyright (C) 2002-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/psaux/t1cmap.h b/vendor/freetype/src/psaux/t1cmap.h index b3702498a5..445e6a2784 100644 --- a/vendor/freetype/src/psaux/t1cmap.h +++ b/vendor/freetype/src/psaux/t1cmap.h @@ -4,7 +4,7 @@ * * Type 1 character map support (specification). * - * Copyright (C) 2002-2023 by + * Copyright (C) 2002-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/psaux/t1decode.c b/vendor/freetype/src/psaux/t1decode.c index 4b6b969bcb..c74baa8038 100644 --- a/vendor/freetype/src/psaux/t1decode.c +++ b/vendor/freetype/src/psaux/t1decode.c @@ -4,7 +4,7 @@ * * PostScript Type 1 decoding routines (body). * - * Copyright (C) 2000-2023 by + * Copyright (C) 2000-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/psaux/t1decode.h b/vendor/freetype/src/psaux/t1decode.h index 0970def960..16203b8f73 100644 --- a/vendor/freetype/src/psaux/t1decode.h +++ b/vendor/freetype/src/psaux/t1decode.h @@ -4,7 +4,7 @@ * * PostScript Type 1 decoding routines (specification). * - * Copyright (C) 2000-2023 by + * Copyright (C) 2000-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/pshinter/pshalgo.c b/vendor/freetype/src/pshinter/pshalgo.c index 4f622e1e44..967767b348 100644 --- a/vendor/freetype/src/pshinter/pshalgo.c +++ b/vendor/freetype/src/pshinter/pshalgo.c @@ -4,7 +4,7 @@ * * PostScript hinting algorithm (body). * - * Copyright (C) 2001-2023 by + * Copyright (C) 2001-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used @@ -1118,7 +1118,7 @@ FT_UInt n; PSH_Point point = glyph->points; FT_Vector* vec = glyph->outline->points; - char* tags = glyph->outline->tags; + FT_Byte* tags = glyph->outline->tags; for ( n = 0; n < glyph->num_points; n++ ) @@ -1171,8 +1171,8 @@ FT_QNEW_ARRAY( glyph->contours, outline->n_contours ) ) goto Exit; - glyph->num_points = (FT_UInt)outline->n_points; - glyph->num_contours = (FT_UInt)outline->n_contours; + glyph->num_points = outline->n_points; + glyph->num_contours = outline->n_contours; { FT_UInt first = 0, next, n; @@ -1186,7 +1186,7 @@ PSH_Point point; - next = (FT_UInt)outline->contours[n] + 1; + next = outline->contours[n] + 1; count = next - first; contour->start = points + first; diff --git a/vendor/freetype/src/pshinter/pshalgo.h b/vendor/freetype/src/pshinter/pshalgo.h index 3f0ba28a69..fb362f061b 100644 --- a/vendor/freetype/src/pshinter/pshalgo.h +++ b/vendor/freetype/src/pshinter/pshalgo.h @@ -4,7 +4,7 @@ * * PostScript hinting algorithm (specification). * - * Copyright (C) 2001-2023 by + * Copyright (C) 2001-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/pshinter/pshglob.c b/vendor/freetype/src/pshinter/pshglob.c index d4c5eb32b1..435f45838f 100644 --- a/vendor/freetype/src/pshinter/pshglob.c +++ b/vendor/freetype/src/pshinter/pshglob.c @@ -5,7 +5,7 @@ * PostScript hinter global hinting management (body). * Inspired by the new auto-hinter module. * - * Copyright (C) 2001-2023 by + * Copyright (C) 2001-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used diff --git a/vendor/freetype/src/pshinter/pshglob.h b/vendor/freetype/src/pshinter/pshglob.h index 579eb2148a..c5a5c91316 100644 --- a/vendor/freetype/src/pshinter/pshglob.h +++ b/vendor/freetype/src/pshinter/pshglob.h @@ -4,7 +4,7 @@ * * PostScript hinter global hinting management. * - * Copyright (C) 2001-2023 by + * Copyright (C) 2001-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/pshinter/pshinter.c b/vendor/freetype/src/pshinter/pshinter.c index 54ed410966..ae2b53fee5 100644 --- a/vendor/freetype/src/pshinter/pshinter.c +++ b/vendor/freetype/src/pshinter/pshinter.c @@ -4,7 +4,7 @@ * * FreeType PostScript Hinting module * - * Copyright (C) 2001-2023 by + * Copyright (C) 2001-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/pshinter/pshmod.c b/vendor/freetype/src/pshinter/pshmod.c index 974a99e018..9965d5b16b 100644 --- a/vendor/freetype/src/pshinter/pshmod.c +++ b/vendor/freetype/src/pshinter/pshmod.c @@ -4,7 +4,7 @@ * * FreeType PostScript hinter module implementation (body). * - * Copyright (C) 2001-2023 by + * Copyright (C) 2001-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/pshinter/pshmod.h b/vendor/freetype/src/pshinter/pshmod.h index 4bd781a35d..62ac0a60fd 100644 --- a/vendor/freetype/src/pshinter/pshmod.h +++ b/vendor/freetype/src/pshinter/pshmod.h @@ -4,7 +4,7 @@ * * PostScript hinter module interface (specification). * - * Copyright (C) 2001-2023 by + * Copyright (C) 2001-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/pshinter/pshnterr.h b/vendor/freetype/src/pshinter/pshnterr.h index 97624952d8..e9641340e5 100644 --- a/vendor/freetype/src/pshinter/pshnterr.h +++ b/vendor/freetype/src/pshinter/pshnterr.h @@ -4,7 +4,7 @@ * * PS Hinter error codes (specification only). * - * Copyright (C) 2003-2023 by + * Copyright (C) 2003-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/pshinter/pshrec.c b/vendor/freetype/src/pshinter/pshrec.c index 680e6d0135..0b2b549fc2 100644 --- a/vendor/freetype/src/pshinter/pshrec.c +++ b/vendor/freetype/src/pshinter/pshrec.c @@ -4,7 +4,7 @@ * * FreeType PostScript hints recorder (body). * - * Copyright (C) 2001-2023 by + * Copyright (C) 2001-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -806,7 +806,7 @@ ps_hints_stem( PS_Hints hints, FT_UInt dimension, FT_Int count, - FT_Long* stems ) + FT_Pos* stems ) { PS_Dimension dim; diff --git a/vendor/freetype/src/pshinter/pshrec.h b/vendor/freetype/src/pshinter/pshrec.h index 0b2484af12..7e375af7ba 100644 --- a/vendor/freetype/src/pshinter/pshrec.h +++ b/vendor/freetype/src/pshinter/pshrec.h @@ -4,7 +4,7 @@ * * Postscript (Type1/Type2) hints recorder (specification). * - * Copyright (C) 2001-2023 by + * Copyright (C) 2001-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/psnames/psmodule.c b/vendor/freetype/src/psnames/psmodule.c index 8203a0465d..35d054d1cf 100644 --- a/vendor/freetype/src/psnames/psmodule.c +++ b/vendor/freetype/src/psnames/psmodule.c @@ -4,7 +4,7 @@ * * psnames module implementation (body). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/psnames/psmodule.h b/vendor/freetype/src/psnames/psmodule.h index 0904700bfb..770458316b 100644 --- a/vendor/freetype/src/psnames/psmodule.h +++ b/vendor/freetype/src/psnames/psmodule.h @@ -4,7 +4,7 @@ * * High-level psnames module interface (specification). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/psnames/psnamerr.h b/vendor/freetype/src/psnames/psnamerr.h index 0073f82284..e123eb65e3 100644 --- a/vendor/freetype/src/psnames/psnamerr.h +++ b/vendor/freetype/src/psnames/psnamerr.h @@ -4,7 +4,7 @@ * * PS names module error codes (specification only). * - * Copyright (C) 2001-2023 by + * Copyright (C) 2001-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/psnames/psnames.c b/vendor/freetype/src/psnames/psnames.c index 93ed9332fa..2933af1bf5 100644 --- a/vendor/freetype/src/psnames/psnames.c +++ b/vendor/freetype/src/psnames/psnames.c @@ -4,7 +4,7 @@ * * FreeType psnames module component (body only). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/psnames/pstables.h b/vendor/freetype/src/psnames/pstables.h index 7f92cce603..2a941b0460 100644 --- a/vendor/freetype/src/psnames/pstables.h +++ b/vendor/freetype/src/psnames/pstables.h @@ -4,7 +4,7 @@ * * PostScript glyph names. * - * Copyright (C) 2005-2023 by + * Copyright (C) 2005-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/raster/ftmisc.h b/vendor/freetype/src/raster/ftmisc.h index 33dbfd631e..943f2aa0a5 100644 --- a/vendor/freetype/src/raster/ftmisc.h +++ b/vendor/freetype/src/raster/ftmisc.h @@ -5,7 +5,7 @@ * Miscellaneous macros for stand-alone rasterizer (specification * only). * - * Copyright (C) 2005-2023 by + * Copyright (C) 2005-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used @@ -92,27 +92,6 @@ #endif - static FT_Long - FT_MulDiv( FT_Long a, - FT_Long b, - FT_Long c ) - { - FT_Int s; - FT_Long d; - - - s = 1; - if ( a < 0 ) { a = -a; s = -1; } - if ( b < 0 ) { b = -b; s = -s; } - if ( c < 0 ) { c = -c; s = -s; } - - d = (FT_Long)( c > 0 ? ( (FT_Int64)a * b + ( c >> 1 ) ) / c - : 0x7FFFFFFFL ); - - return ( s > 0 ) ? d : -d; - } - - static FT_Long FT_MulDiv_No_Round( FT_Long a, FT_Long b, diff --git a/vendor/freetype/src/raster/ftraster.c b/vendor/freetype/src/raster/ftraster.c index 192ca0701a..e4b7b937d5 100644 --- a/vendor/freetype/src/raster/ftraster.c +++ b/vendor/freetype/src/raster/ftraster.c @@ -4,7 +4,7 @@ * * The FreeType glyph rasterizer (body). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -63,8 +63,7 @@ #else /* !STANDALONE_ */ #include "ftraster.h" -#include /* for FT_MulDiv and FT_MulDiv_No_Round */ -#include /* for FT_Outline_Get_CBox */ +#include /* for FT_MulDiv_No_Round */ #endif /* !STANDALONE_ */ @@ -115,12 +114,12 @@ * a change of direction is detected in the outline, a new profile is * generated until the end of the outline. * - * Note that when all profiles have been generated, the function - * Finalize_Profile_Table() is used to record, for each profile, its - * bottom-most scanline as well as the scanline above its upmost - * boundary. These positions are called `y-turns' because they (sort - * of) correspond to local extrema. They are stored in a sorted list - * built from the top of the render pool as a downwards stack: + * Note that, for all generated profiles, the function End_Profile() + * is used to record all their bottom-most scanlines as well as the + * scanline above their upmost boundary. These positions are called + * `y-turns' because they (sort of) correspond to local extrema. + * They are stored in a sorted list built from the top of the render + * pool as a downwards stack: * * _ _ _______________________________________ * | | @@ -136,7 +135,7 @@ * optimize performance (see technical note on the sweep below). * * Of course, the raster detects whether the two stacks collide and - * handles the situation properly. + * handles the situation by bisecting the job and restarting. * */ @@ -252,7 +251,6 @@ /* On the other hand, SMulDiv means `Slow MulDiv', and is used typically */ /* for clipping computations. It simply uses the FT_MulDiv() function */ /* defined in `ftcalc.h'. */ -#define SMulDiv FT_MulDiv #define SMulDiv_No_Round FT_MulDiv_No_Round /* The rasterizer is a very general purpose component; please leave */ @@ -305,16 +303,6 @@ typedef unsigned char Byte, *PByte; typedef char Bool; - - typedef union Alignment_ - { - Long l; - void* p; - void (*f)(void); - - } Alignment, *PAlignment; - - typedef struct TPoint_ { Long x; @@ -327,6 +315,7 @@ #define Flow_Up 0x08U #define Overshoot_Top 0x10U #define Overshoot_Bottom 0x20U +#define Dropout 0x40U /* States of each line, arc, and profile */ @@ -345,31 +334,28 @@ struct TProfile_ { - FT_F26Dot6 X; /* current coordinate during sweep */ PProfile link; /* link to next profile (various purposes) */ - PLong offset; /* start of profile's data in render pool */ + PProfile next; /* next profile in same contour, used */ + /* during drop-out control */ + Int offset; /* bottom or currently scanned array index */ + Int height; /* profile's height in scanlines */ + Int start; /* profile's starting scanline, also use */ + /* as activation counter */ UShort flags; /* Bit 0-2: drop-out mode */ /* Bit 3: profile orientation (up/down) */ /* Bit 4: is top profile? */ /* Bit 5: is bottom profile? */ - Long height; /* profile's height in scanlines */ - Long start; /* profile's starting scanline */ + /* Bit 6: dropout detected */ - Int countL; /* number of lines to step before this */ - /* profile becomes drawable */ - - PProfile next; /* next profile in same contour, used */ - /* during drop-out control */ + FT_F26Dot6 X; /* current coordinate during sweep */ + Long x[1]; /* actually variable array of scanline */ + /* intersections with `height` elements */ }; typedef PProfile TProfileList; typedef PProfile* PProfileList; -#define AlignProfileSize \ - ( ( sizeof ( TProfile ) + sizeof ( Alignment ) - 1 ) / sizeof ( Long ) ) - - #undef RAS_ARG #undef RAS_ARGS #undef RAS_VAR @@ -407,15 +393,13 @@ /* prototypes used for sweep function dispatch */ typedef void - Function_Sweep_Init( RAS_ARGS Short min, - Short max ); + Function_Sweep_Init( RAS_ARGS Int min, + Int max ); typedef void - Function_Sweep_Span( RAS_ARGS Short y, + Function_Sweep_Span( RAS_ARGS Int y, FT_F26Dot6 x1, - FT_F26Dot6 x2, - PProfile left, - PProfile right ); + FT_F26Dot6 x2 ); typedef void Function_Sweep_Step( RAS_ARG ); @@ -441,8 +425,7 @@ (Bool)( x - FLOOR( x ) >= ras.precision_half ) /* Smart dropout rounding to find which pixel is closer to span ends. */ - /* To mimick Windows, symmetric cases break down indepenently of the */ - /* precision. */ + /* To mimic Windows, symmetric cases do not depend on the precision. */ #define SMART( p, q ) FLOOR( ( (p) + (q) + ras.precision * 63 / 64 ) >> 1 ) #if FT_RENDER_POOL_SIZE > 2048 @@ -462,7 +445,6 @@ Int precision_half; Int precision_scale; Int precision_step; - Int precision_jitter; PLong buff; /* The profiles buffer */ PLong sizeBuff; /* Render pool size */ @@ -471,24 +453,14 @@ FT_Error error; - Int numTurns; /* number of Y-turns in outline */ - Byte dropOutControl; /* current drop_out control method */ - UShort bWidth; /* target bitmap width */ - PByte bOrigin; /* target bitmap bottom-left origin */ - PByte bLine; /* target bitmap current line */ - Long lastX, lastY; Long minY, maxY; UShort num_Profs; /* current number of profiles */ + Int numTurns; /* number of Y-turns in outline */ - Bool fresh; /* signals a fresh new profile which */ - /* `start' field must be completed */ - Bool joint; /* signals that the last arc ended */ - /* exactly on a scanline. Allows */ - /* removal of doublets */ PProfile cProfile; /* current profile */ PProfile fProfile; /* head of linked list of profiles */ PProfile gProfile; /* contour's first profile in case */ @@ -496,9 +468,14 @@ TStates state; /* rendering state */ - FT_Bitmap target; /* description of target bit/pixmap */ FT_Outline outline; + Int bTop; /* target bitmap max line index */ + Int bRight; /* target bitmap rightmost index */ + Int bPitch; /* target bitmap pitch */ + PByte bOrigin; /* target bitmap bottom-left origin */ + PByte bLine; /* target bitmap current line */ + /* dispatch variables */ Function_Sweep_Init* Proc_Sweep_Init; @@ -563,37 +540,82 @@ * * 256 / (1 << 12) = 0.0625 pixels. * - * `precision_jitter' is an epsilon threshold used in - * `Vertical_Sweep_Span' to deal with small imperfections in the Bezier - * decomposition (after all, we are working with approximations only); - * it avoids switching on additional pixels which would cause artifacts - * otherwise. - * - * The value of `precision_jitter' has been determined heuristically. - * */ if ( High ) { ras.precision_bits = 12; ras.precision_step = 256; - ras.precision_jitter = 30; } else { ras.precision_bits = 6; ras.precision_step = 32; - ras.precision_jitter = 2; } - FT_TRACE6(( "Set_High_Precision(%s)\n", High ? "true" : "false" )); - ras.precision = 1 << ras.precision_bits; ras.precision_half = ras.precision >> 1; ras.precision_scale = ras.precision >> Pixel_Bits; } + /************************************************************************** + * + * @Function: + * Insert_Y_Turn + * + * @Description: + * Insert a salient into the sorted list placed on top of the render + * pool. + * + * @Input: + * New y scanline position. + * + * @Return: + * SUCCESS on success. FAILURE in case of overflow. + */ + static Bool + Insert_Y_Turns( RAS_ARGS Int y, + Int top ) + { + Int n = ras.numTurns; + PLong y_turns = ras.maxBuff; + + + /* update top value */ + if ( n == 0 || top > y_turns[n] ) + y_turns[n] = top; + + /* look for first y value that is <= */ + while ( n-- && y < y_turns[n] ) + ; + + /* if it is <, simply insert it, ignore if == */ + if ( n < 0 || y > y_turns[n] ) + { + ras.maxBuff--; + if ( ras.maxBuff <= ras.top ) + { + ras.error = FT_THROW( Raster_Overflow ); + return FAILURE; + } + + do + { + Int y2 = (Int)y_turns[n]; + + + y_turns[n] = y; + y = y2; + } while ( n-- >= 0 ); + + ras.numTurns++; + } + + return SUCCESS; + } + + /************************************************************************** * * @Function: @@ -606,52 +628,48 @@ * aState :: * The state/orientation of the new profile. * - * overshoot :: - * Whether the profile's unrounded start position - * differs by at least a half pixel. - * * @Return: * SUCCESS on success. FAILURE in case of overflow or of incoherent * profile. */ static Bool - New_Profile( RAS_ARGS TStates aState, - Bool overshoot ) + New_Profile( RAS_ARGS TStates aState ) { - if ( !ras.fProfile ) + Long e; + + + if ( !ras.cProfile || ras.cProfile->height ) { ras.cProfile = (PProfile)ras.top; - ras.fProfile = ras.cProfile; - ras.top += AlignProfileSize; - } + ras.top = ras.cProfile->x; - if ( ras.top >= ras.maxBuff ) - { - ras.error = FT_THROW( Raster_Overflow ); - return FAILURE; + if ( ras.top >= ras.maxBuff ) + { + FT_TRACE1(( "overflow in New_Profile\n" )); + ras.error = FT_THROW( Raster_Overflow ); + return FAILURE; + } + + ras.cProfile->height = 0; } - ras.cProfile->start = 0; - ras.cProfile->height = 0; - ras.cProfile->offset = ras.top; - ras.cProfile->link = (PProfile)0; - ras.cProfile->next = (PProfile)0; ras.cProfile->flags = ras.dropOutControl; switch ( aState ) { case Ascending_State: ras.cProfile->flags |= Flow_Up; - if ( overshoot ) + if ( IS_BOTTOM_OVERSHOOT( ras.lastY ) ) ras.cProfile->flags |= Overshoot_Bottom; - FT_TRACE6(( " new ascending profile = %p\n", (void *)ras.cProfile )); + e = CEILING( ras.lastY ); break; case Descending_State: - if ( overshoot ) + if ( IS_TOP_OVERSHOOT( ras.lastY ) ) ras.cProfile->flags |= Overshoot_Top; - FT_TRACE6(( " new descending profile = %p\n", (void *)ras.cProfile )); + + e = FLOOR( ras.lastY ); break; default: @@ -660,12 +678,20 @@ return FAILURE; } - if ( !ras.gProfile ) - ras.gProfile = ras.cProfile; + if ( e > ras.maxY ) + e = ras.maxY; + if ( e < ras.minY ) + e = ras.minY; + ras.cProfile->start = (Int)TRUNC( e ); + + FT_TRACE7(( " new %s profile = %p, start = %d\n", + aState == Ascending_State ? "ascending" : "descending", + (void *)ras.cProfile, ras.cProfile->start )); + + if ( ras.lastY == e ) + *ras.top++ = ras.lastX; ras.state = aState; - ras.fresh = TRUE; - ras.joint = FALSE; return SUCCESS; } @@ -677,24 +703,19 @@ * End_Profile * * @Description: - * Finalize the current profile. - * - * @Input: - * overshoot :: - * Whether the profile's unrounded end position differs - * by at least a half pixel. + * Finalize the current profile and record y-turns. * * @Return: * SUCCESS on success. FAILURE in case of overflow or incoherency. */ static Bool - End_Profile( RAS_ARGS Bool overshoot ) + End_Profile( RAS_ARG ) { - Long h; + PProfile p = ras.cProfile; + Int h = (Int)( ras.top - p->x ); + Int bottom, top; - h = (Long)( ras.top - ras.cProfile->offset ); - if ( h < 0 ) { FT_ERROR(( "End_Profile: negative height encountered\n" )); @@ -704,98 +725,46 @@ if ( h > 0 ) { - PProfile oldProfile; + FT_TRACE7(( " ending profile %p, start = %2d, height = %+3d\n", + (void *)p, p->start, p->flags & Flow_Up ? h : -h )); + p->height = h; - FT_TRACE6(( " ending profile %p, start = %ld, height = %ld\n", - (void *)ras.cProfile, ras.cProfile->start, h )); + if ( p->flags & Flow_Up ) + { + if ( IS_TOP_OVERSHOOT( ras.lastY ) ) + p->flags |= Overshoot_Top; - ras.cProfile->height = h; - if ( overshoot ) + bottom = p->start; + top = bottom + h; + p->offset = 0; + p->X = p->x[0]; + } + else { - if ( ras.cProfile->flags & Flow_Up ) - ras.cProfile->flags |= Overshoot_Top; - else - ras.cProfile->flags |= Overshoot_Bottom; + if ( IS_BOTTOM_OVERSHOOT( ras.lastY ) ) + p->flags |= Overshoot_Bottom; + + top = p->start + 1; + bottom = top - h; + p->start = bottom; + p->offset = h - 1; + p->X = p->x[h - 1]; } - oldProfile = ras.cProfile; - ras.cProfile = (PProfile)ras.top; + if ( Insert_Y_Turns( RAS_VARS bottom, top ) ) + return FAILURE; - ras.top += AlignProfileSize; + if ( !ras.gProfile ) + ras.gProfile = p; - ras.cProfile->height = 0; - ras.cProfile->offset = ras.top; + /* preliminary values to be finalized */ + p->next = ras.gProfile; + p->link = (PProfile)ras.top; - oldProfile->next = ras.cProfile; ras.num_Profs++; } - if ( ras.top >= ras.maxBuff ) - { - FT_TRACE1(( "overflow in End_Profile\n" )); - ras.error = FT_THROW( Raster_Overflow ); - return FAILURE; - } - - ras.joint = FALSE; - - return SUCCESS; - } - - - /************************************************************************** - * - * @Function: - * Insert_Y_Turn - * - * @Description: - * Insert a salient into the sorted list placed on top of the render - * pool. - * - * @Input: - * New y scanline position. - * - * @Return: - * SUCCESS on success. FAILURE in case of overflow. - */ - static Bool - Insert_Y_Turn( RAS_ARGS Int y ) - { - PLong y_turns; - Int n; - - - n = ras.numTurns - 1; - y_turns = ras.sizeBuff - ras.numTurns; - - /* look for first y value that is <= */ - while ( n >= 0 && y < y_turns[n] ) - n--; - - /* if it is <, simply insert it, ignore if == */ - if ( n >= 0 && y > y_turns[n] ) - do - { - Int y2 = (Int)y_turns[n]; - - - y_turns[n] = y; - y = y2; - } while ( --n >= 0 ); - - if ( n < 0 ) - { - ras.maxBuff--; - if ( ras.maxBuff <= ras.top ) - { - ras.error = FT_THROW( Raster_Overflow ); - return FAILURE; - } - ras.numTurns++; - ras.sizeBuff[-ras.numTurns] = y; - } - return SUCCESS; } @@ -807,56 +776,29 @@ * * @Description: * Adjust all links in the profiles list. - * - * @Return: - * SUCCESS on success. FAILURE in case of overflow. */ - static Bool + static void Finalize_Profile_Table( RAS_ARG ) { - UShort n; - PProfile p; - + UShort n = ras.num_Profs; + PProfile p = ras.fProfile; + PProfile q; - n = ras.num_Profs; - p = ras.fProfile; - if ( n > 1 && p ) + /* there should be at least two profiles, up and down */ + while ( --n ) { - do - { - Int bottom, top; + q = p->link; + /* fix the contour loop */ + if ( q->next == p->next ) + p->next = q; - if ( n > 1 ) - p->link = (PProfile)( p->offset + p->height ); - else - p->link = NULL; - - if ( p->flags & Flow_Up ) - { - bottom = (Int)p->start; - top = (Int)( p->start + p->height - 1 ); - } - else - { - bottom = (Int)( p->start - p->height + 1 ); - top = (Int)p->start; - p->start = bottom; - p->offset += p->height - 1; - } - - if ( Insert_Y_Turn( RAS_VARS bottom ) || - Insert_Y_Turn( RAS_VARS top + 1 ) ) - return FAILURE; - - p = p->link; - } while ( --n ); + p = q; } - else - ras.fProfile = NULL; - return SUCCESS; + /* null-terminate */ + p->link = NULL; } @@ -986,107 +928,78 @@ Long miny, Long maxy ) { - Long Dx, Dy; - Int e1, e2, f1, f2, size; /* XXX: is `Short' sufficient? */ - Long Ix, Rx, Ax; + Long e, e2, Dx, Dy; + Long Ix, Rx, Ax; + Int size; PLong top; - Dx = x2 - x1; - Dy = y2 - y1; - - if ( Dy <= 0 || y2 < miny || y1 > maxy ) + if ( y2 < miny || y1 > maxy ) return SUCCESS; - if ( y1 < miny ) - { - /* Take care: miny-y1 can be a very large value; we use */ - /* a slow MulDiv function to avoid clipping bugs */ - x1 += SMulDiv( Dx, miny - y1, Dy ); - e1 = (Int)TRUNC( miny ); - f1 = 0; - } - else - { - e1 = (Int)TRUNC( y1 ); - f1 = (Int)FRAC( y1 ); - } + e2 = y2 > maxy ? maxy : FLOOR( y2 ); + e = y1 < miny ? miny : CEILING( y1 ); - if ( y2 > maxy ) - { - /* x2 += FMulDiv( Dx, maxy - y2, Dy ); UNNECESSARY */ - e2 = (Int)TRUNC( maxy ); - f2 = 0; - } - else - { - e2 = (Int)TRUNC( y2 ); - f2 = (Int)FRAC( y2 ); - } + if ( y1 == e ) + e += ras.precision; - if ( f1 > 0 ) - { - if ( e1 == e2 ) - return SUCCESS; - else - { - x1 += SMulDiv( Dx, ras.precision - f1, Dy ); - e1 += 1; - } - } - else - if ( ras.joint ) - { - ras.top--; - ras.joint = FALSE; - } - - ras.joint = (char)( f2 == 0 ); + if ( e2 < e ) /* nothing to do */ + return SUCCESS; - if ( ras.fresh ) - { - ras.cProfile->start = e1; - ras.fresh = FALSE; - } + size = (Int)TRUNC( e2 - e ) + 1; + top = ras.top; - size = e2 - e1 + 1; - if ( ras.top + size >= ras.maxBuff ) + if ( top + size >= ras.maxBuff ) { ras.error = FT_THROW( Raster_Overflow ); return FAILURE; } - if ( Dx > 0 ) - { - Ix = SMulDiv_No_Round( ras.precision, Dx, Dy ); - Rx = ( ras.precision * Dx ) % Dy; - Dx = 1; - } - else + Dx = x2 - x1; + Dy = y2 - y1; + + if ( Dx == 0 ) /* very easy */ { - Ix = -SMulDiv_No_Round( ras.precision, -Dx, Dy ); - Rx = ( ras.precision * -Dx ) % Dy; - Dx = -1; + do + *top++ = x1; + while ( --size ); + goto Fin; } - Ax = -Dy; - top = ras.top; + Ix = SMulDiv_No_Round( e - y1, Dx, Dy ); + x1 += Ix; + *top++ = x1; - while ( size > 0 ) + if ( --size ) { - *top++ = x1; + Ax = Dx * ( e - y1 ) - Dy * Ix; /* remainder */ + Ix = FMulDiv( ras.precision, Dx, Dy ); + Rx = Dx * ras.precision - Dy * Ix; /* remainder */ + Dx = 1; - x1 += Ix; - Ax += Rx; - if ( Ax >= 0 ) + if ( x2 < x1 ) + { + Ax = -Ax; + Rx = -Rx; + Dx = -Dx; + } + + do { - Ax -= Dy; - x1 += Dx; + x1 += Ix; + Ax += Rx; + if ( Ax >= Dy ) + { + Ax -= Dy; + x1 += Dx; + } + *top++ = x1; } - size--; + while ( --size ); } + Fin: ras.top = top; return SUCCESS; } @@ -1131,17 +1044,7 @@ Long miny, Long maxy ) { - Bool result, fresh; - - - fresh = ras.fresh; - - result = Line_Up( RAS_VARS x1, -y1, x2, -y2, -maxy, -miny ); - - if ( fresh && !ras.fresh ) - ras.cProfile->start = -ras.cProfile->start; - - return result; + return Line_Up( RAS_VARS x1, -y1, x2, -y2, -maxy, -miny ); } @@ -1181,105 +1084,73 @@ Long miny, Long maxy ) { - Long y1, y2, e, e2, e0; - Short f1; + Long y1, y2, e, e2, dy; + Long dx, x2; - TPoint* start_arc; - - PLong top; + PLong top; y1 = arc[degree].y; y2 = arc[0].y; - top = ras.top; if ( y2 < miny || y1 > maxy ) - goto Fin; - - e2 = FLOOR( y2 ); - - if ( e2 > maxy ) - e2 = maxy; - - e0 = miny; - - if ( y1 < miny ) - e = miny; - else - { - e = CEILING( y1 ); - f1 = (Short)( FRAC( y1 ) ); - e0 = e; - - if ( f1 == 0 ) - { - if ( ras.joint ) - { - top--; - ras.joint = FALSE; - } + return SUCCESS; - *top++ = arc[degree].x; + e2 = y2 > maxy ? maxy : FLOOR( y2 ); + e = y1 < miny ? miny : CEILING( y1 ); - e += ras.precision; - } - } + if ( y1 == e ) + e += ras.precision; - if ( ras.fresh ) - { - ras.cProfile->start = TRUNC( e0 ); - ras.fresh = FALSE; - } + if ( e2 < e ) /* nothing to do */ + return SUCCESS; - if ( e2 < e ) - goto Fin; + top = ras.top; if ( ( top + TRUNC( e2 - e ) + 1 ) >= ras.maxBuff ) { - ras.top = top; ras.error = FT_THROW( Raster_Overflow ); return FAILURE; } - start_arc = arc; - do { - ras.joint = FALSE; - y2 = arc[0].y; + x2 = arc[0].x; if ( y2 > e ) { - y1 = arc[degree].y; - if ( y2 - y1 >= ras.precision_step ) + dy = y2 - arc[degree].y; + dx = x2 - arc[degree].x; + + /* split condition should be invariant of direction */ + if ( dy > ras.precision_step || + dx > ras.precision_step || + -dx > ras.precision_step ) { splitter( arc ); arc += degree; } else { - *top++ = arc[degree].x + FMulDiv( arc[0].x - arc[degree].x, - e - y1, y2 - y1 ); + *top++ = x2 - FMulDiv( y2 - e, dx, dy ); + e += ras.precision; arc -= degree; - e += ras.precision; } } else { if ( y2 == e ) { - ras.joint = TRUE; - *top++ = arc[0].x; - - e += ras.precision; + *top++ = x2; + e += ras.precision; } - arc -= degree; + arc -= degree; } - } while ( arc >= start_arc && e <= e2 ); + } + while ( e <= e2 ); - Fin: - ras.top = top; + ras.top = top; return SUCCESS; } @@ -1316,7 +1187,7 @@ Long miny, Long maxy ) { - Bool result, fresh; + Bool result; arc[0].y = -arc[0].y; @@ -1325,13 +1196,8 @@ if ( degree > 2 ) arc[3].y = -arc[3].y; - fresh = ras.fresh; - result = Bezier_Up( RAS_VARS degree, arc, splitter, -maxy, -miny ); - if ( fresh && !ras.fresh ) - ras.cProfile->start = -ras.cProfile->start; - arc[0].y = -arc[0].y; return result; } @@ -1362,74 +1228,50 @@ Line_To( RAS_ARGS Long x, Long y ) { - /* First, detect a change of direction */ + TStates state; - switch ( ras.state ) - { - case Unknown_State: - if ( y > ras.lastY ) - { - if ( New_Profile( RAS_VARS Ascending_State, - IS_BOTTOM_OVERSHOOT( ras.lastY ) ) ) - return FAILURE; - } - else - { - if ( y < ras.lastY ) - if ( New_Profile( RAS_VARS Descending_State, - IS_TOP_OVERSHOOT( ras.lastY ) ) ) - return FAILURE; - } - break; - case Ascending_State: - if ( y < ras.lastY ) - { - if ( End_Profile( RAS_VARS IS_TOP_OVERSHOOT( ras.lastY ) ) || - New_Profile( RAS_VARS Descending_State, - IS_TOP_OVERSHOOT( ras.lastY ) ) ) - return FAILURE; - } - break; + if ( y == ras.lastY ) + goto Fin; - case Descending_State: - if ( y > ras.lastY ) - { - if ( End_Profile( RAS_VARS IS_BOTTOM_OVERSHOOT( ras.lastY ) ) || - New_Profile( RAS_VARS Ascending_State, - IS_BOTTOM_OVERSHOOT( ras.lastY ) ) ) - return FAILURE; - } - break; + /* First, detect a change of direction */ - default: - ; + state = ras.lastY < y ? Ascending_State : Descending_State; + + if ( ras.state != state ) + { + /* finalize current profile if any */ + if ( ras.state != Unknown_State && + End_Profile( RAS_VAR ) ) + goto Fail; + + /* create a new profile */ + if ( New_Profile( RAS_VARS state ) ) + goto Fail; } /* Then compute the lines */ - switch ( ras.state ) + if ( state == Ascending_State ) { - case Ascending_State: if ( Line_Up( RAS_VARS ras.lastX, ras.lastY, x, y, ras.minY, ras.maxY ) ) - return FAILURE; - break; - - case Descending_State: + goto Fail; + } + else + { if ( Line_Down( RAS_VARS ras.lastX, ras.lastY, x, y, ras.minY, ras.maxY ) ) - return FAILURE; - break; - - default: - ; + goto Fail; } + Fin: ras.lastX = x; ras.lastY = y; - return SUCCESS; + + Fail: + return FAILURE; } @@ -1500,7 +1342,7 @@ ymax = y1; } - if ( y2 < ymin || y2 > ymax ) + if ( y2 < FLOOR( ymin ) || y2 > CEILING( ymax ) ) { /* this arc has no given direction, split it! */ Split_Conic( arc ); @@ -1508,8 +1350,12 @@ } else if ( y1 == y3 ) { - /* this arc is flat, ignore it and pop it from the Bezier stack */ + /* this arc is flat, advance position */ + /* and pop it from the Bezier stack */ arc -= 2; + + ras.lastX = x3; + ras.lastY = y3; } else { @@ -1518,18 +1364,13 @@ state_bez = y1 < y3 ? Ascending_State : Descending_State; if ( ras.state != state_bez ) { - Bool o = ( state_bez == Ascending_State ) - ? IS_BOTTOM_OVERSHOOT( y1 ) - : IS_TOP_OVERSHOOT( y1 ); - - /* finalize current profile if any */ if ( ras.state != Unknown_State && - End_Profile( RAS_VARS o ) ) + End_Profile( RAS_VAR ) ) goto Fail; /* create a new profile */ - if ( New_Profile( RAS_VARS state_bez, o ) ) + if ( New_Profile( RAS_VARS state_bez ) ) goto Fail; } @@ -1545,13 +1386,13 @@ ras.minY, ras.maxY ) ) goto Fail; arc -= 2; + + ras.lastX = x3; + ras.lastY = y3; } } while ( arc >= arcs ); - ras.lastX = x3; - ras.lastY = y3; - return SUCCESS; Fail: @@ -1648,7 +1489,7 @@ ymax2 = y2; } - if ( ymin2 < ymin1 || ymax2 > ymax1 ) + if ( ymin2 < FLOOR( ymin1 ) || ymax2 > CEILING( ymax1 ) ) { /* this arc has no given direction, split it! */ Split_Cubic( arc ); @@ -1656,27 +1497,26 @@ } else if ( y1 == y4 ) { - /* this arc is flat, ignore it and pop it from the Bezier stack */ + /* this arc is flat, advance position */ + /* and pop it from the Bezier stack */ arc -= 3; + + ras.lastX = x4; + ras.lastY = y4; } else { - state_bez = ( y1 <= y4 ) ? Ascending_State : Descending_State; + state_bez = y1 < y4 ? Ascending_State : Descending_State; /* detect a change of direction */ if ( ras.state != state_bez ) { - Bool o = ( state_bez == Ascending_State ) - ? IS_BOTTOM_OVERSHOOT( y1 ) - : IS_TOP_OVERSHOOT( y1 ); - - /* finalize current profile if any */ if ( ras.state != Unknown_State && - End_Profile( RAS_VARS o ) ) + End_Profile( RAS_VAR ) ) goto Fail; - if ( New_Profile( RAS_VARS state_bez, o ) ) + if ( New_Profile( RAS_VARS state_bez ) ) goto Fail; } @@ -1692,13 +1532,13 @@ ras.minY, ras.maxY ) ) goto Fail; arc -= 3; + + ras.lastX = x4; + ras.lastY = y4; } } while ( arc >= arcs ); - ras.lastX = x4; - ras.lastY = y4; - return SUCCESS; Fail: @@ -1740,6 +1580,11 @@ * * @Return: * SUCCESS on success, FAILURE on error. + * + * @Note: + * Unlike FT_Outline_Decompose(), this function handles the scanmode + * dropout tags in the individual contours. Therefore, it cannot be + * replaced. */ static Bool Decompose_Curve( RAS_ARGS Int first, @@ -1753,7 +1598,7 @@ FT_Vector* points; FT_Vector* point; FT_Vector* limit; - char* tags; + FT_Byte* tags; UInt tag; /* current point's state */ @@ -1974,24 +1819,17 @@ ras.fProfile = NULL; - ras.joint = FALSE; - ras.fresh = FALSE; - - ras.maxBuff = ras.sizeBuff - AlignProfileSize; + ras.cProfile = NULL; - ras.numTurns = 0; + ras.top = ras.buff; + ras.maxBuff = ras.sizeBuff - 1; /* top reserve */ - ras.cProfile = (PProfile)ras.top; - ras.cProfile->offset = ras.top; - ras.num_Profs = 0; + ras.numTurns = 0; + ras.num_Profs = 0; last = -1; for ( i = 0; i < ras.outline.n_contours; i++ ) { - PProfile lastProfile; - Bool o; - - ras.state = Unknown_State; ras.gProfile = NULL; @@ -2001,35 +1839,30 @@ if ( Decompose_Curve( RAS_VARS first, last, flipped ) ) return FAILURE; + /* Note that ras.gProfile can stay nil if the contour was */ + /* too small to be drawn or degenerate. */ + if ( !ras.gProfile ) + continue; + /* we must now check whether the extreme arcs join or not */ if ( FRAC( ras.lastY ) == 0 && ras.lastY >= ras.minY && ras.lastY <= ras.maxY ) - if ( ras.gProfile && - ( ras.gProfile->flags & Flow_Up ) == + if ( ( ras.gProfile->flags & Flow_Up ) == ( ras.cProfile->flags & Flow_Up ) ) ras.top--; - /* Note that ras.gProfile can be nil if the contour was too small */ - /* to be drawn. */ - lastProfile = ras.cProfile; - if ( ras.top != ras.cProfile->offset && - ( ras.cProfile->flags & Flow_Up ) ) - o = IS_TOP_OVERSHOOT( ras.lastY ); - else - o = IS_BOTTOM_OVERSHOOT( ras.lastY ); - if ( End_Profile( RAS_VARS o ) ) + if ( End_Profile( RAS_VAR ) ) return FAILURE; - /* close the `next profile in contour' linked list */ - if ( ras.gProfile ) - lastProfile->next = ras.gProfile; + if ( !ras.fProfile ) + ras.fProfile = ras.gProfile; } - if ( Finalize_Profile_Table( RAS_VAR ) ) - return FAILURE; + if ( ras.fProfile ) + Finalize_Profile_Table( RAS_VAR ); - return (Bool)( ras.top < ras.maxBuff ? SUCCESS : FAILURE ); + return SUCCESS; } @@ -2042,24 +1875,11 @@ /*************************************************************************/ - /************************************************************************** - * - * Init_Linked - * - * Initializes an empty linked list. - */ - static void - Init_Linked( TProfileList* l ) - { - *l = NULL; - } - - /************************************************************************** * * InsNew * - * Inserts a new profile in a linked list. + * Inserts a new profile in a linked list, sorted by coordinate. */ static void InsNew( PProfileList list, @@ -2073,10 +1893,8 @@ current = *old; x = profile->X; - while ( current ) + while ( current && current->X < x ) { - if ( x < current->X ) - break; old = ¤t->link; current = *old; } @@ -2088,79 +1906,51 @@ /************************************************************************** * - * DelOld + * Increment * - * Removes an old profile from a linked list. + * Advances all profile in the list to the next scanline. It also + * sorts the trace list in the unlikely case of profile crossing. + * The profiles are inserted in sorted order. We might need a single + * swap to fix it when profiles (contours) cross. + * Bubble sort with immediate restart is good enough and simple. */ static void - DelOld( PProfileList list, - const PProfile profile ) + Increment( PProfileList list, + Int flow ) { - PProfile *old, current; - + PProfile *old, current, next; - old = list; - current = *old; - while ( current ) + /* First, set the new X coordinates and remove exhausted profiles */ + old = list; + while ( *old ) { - if ( current == profile ) + current = *old; + if ( --current->height ) { - *old = current->link; - return; + current->offset += flow; + current->X = current->x[current->offset]; + old = ¤t->link; } - - old = ¤t->link; - current = *old; - } - - /* we should never get there, unless the profile was not part of */ - /* the list. */ - } - - - /************************************************************************** - * - * Sort - * - * Sorts a trace list. In 95%, the list is already sorted. We need - * an algorithm which is fast in this case. Bubble sort is enough - * and simple. - */ - static void - Sort( PProfileList list ) - { - PProfile *old, current, next; - - - /* First, set the new X coordinate of each profile */ - current = *list; - while ( current ) - { - current->X = *current->offset; - current->offset += ( current->flags & Flow_Up ) ? 1 : -1; - current->height--; - current = current->link; + else + *old = current->link; /* remove */ } - /* Then sort them */ + /* Then make sure the list remains sorted */ old = list; current = *old; if ( !current ) return; - next = current->link; - - while ( next ) + while ( current->link ) { + next = current->link; + if ( current->X <= next->X ) { old = ¤t->link; - current = *old; - - if ( !current ) - return; + current = next; } else { @@ -2168,11 +1958,10 @@ current->link = next->link; next->link = current; + /* this is likely the only necessary swap -- restart */ old = list; current = *old; } - - next = current->link; } } @@ -2187,74 +1976,51 @@ */ static void - Vertical_Sweep_Init( RAS_ARGS Short min, - Short max ) + Vertical_Sweep_Init( RAS_ARGS Int min, + Int max ) { FT_UNUSED( max ); - ras.bLine = ras.bOrigin - min * ras.target.pitch; + ras.bLine = ras.bOrigin - min * ras.bPitch; } static void - Vertical_Sweep_Span( RAS_ARGS Short y, + Vertical_Sweep_Span( RAS_ARGS Int y, FT_F26Dot6 x1, - FT_F26Dot6 x2, - PProfile left, - PProfile right ) + FT_F26Dot6 x2 ) { - Long e1, e2; - - Int dropOutControl = left->flags & 7; + Int e1 = (Int)TRUNC( CEILING( x1 ) ); + Int e2 = (Int)TRUNC( FLOOR( x2 ) ); FT_UNUSED( y ); - FT_UNUSED( left ); - FT_UNUSED( right ); - /* in high-precision mode, we need 12 digits after the comma to */ - /* represent multiples of 1/(1<<12) = 1/4096 */ - FT_TRACE7(( " y=%d x=[% .12f;% .12f]", + FT_TRACE7(( " y=%d x=[% .*f;% .*f]", y, - (double)x1 / (double)ras.precision, - (double)x2 / (double)ras.precision )); - - /* Drop-out control */ - - e1 = CEILING( x1 ); - e2 = FLOOR( x2 ); - - /* take care of the special case where both the left */ - /* and right contour lie exactly on pixel centers */ - if ( dropOutControl != 2 && - x2 - x1 - ras.precision <= ras.precision_jitter && - e1 != x1 && e2 != x2 ) - e2 = e1; + ras.precision_bits, (double)x1 / (double)ras.precision, + ras.precision_bits, (double)x2 / (double)ras.precision )); - e1 = TRUNC( e1 ); - e2 = TRUNC( e2 ); - - if ( e2 >= 0 && e1 < ras.bWidth ) + if ( e2 >= 0 && e1 <= ras.bRight ) { - Byte* target; + PByte target; - Int c1, c2; - Byte f1, f2; + Int c1, f1, c2, f2; if ( e1 < 0 ) e1 = 0; - if ( e2 >= ras.bWidth ) - e2 = ras.bWidth - 1; + if ( e2 > ras.bRight ) + e2 = ras.bRight; - FT_TRACE7(( " -> x=[%ld;%ld]", e1, e2 )); + FT_TRACE7(( " -> x=[%d;%d]", e1, e2 )); - c1 = (Short)( e1 >> 3 ); - c2 = (Short)( e2 >> 3 ); + c1 = e1 >> 3; + c2 = e2 >> 3; - f1 = (Byte) ( 0xFF >> ( e1 & 7 ) ); - f2 = (Byte) ~( 0x7F >> ( e2 & 7 ) ); + f1 = 0xFF >> ( e1 & 7 ); + f2 = ~0x7F >> ( e2 & 7 ); target = ras.bLine + c1; c2 -= c1; @@ -2280,163 +2046,50 @@ static void - Vertical_Sweep_Drop( RAS_ARGS Short y, + Vertical_Sweep_Drop( RAS_ARGS Int y, FT_F26Dot6 x1, - FT_F26Dot6 x2, - PProfile left, - PProfile right ) + FT_F26Dot6 x2 ) { - Long e1, e2, pxl; - Short c1, f1; - - - FT_TRACE7(( " y=%d x=[% .12f;% .12f]", - y, - (double)x1 / (double)ras.precision, - (double)x2 / (double)ras.precision )); - - /* Drop-out control */ - - /* e2 x2 x1 e1 */ - /* */ - /* ^ | */ - /* | | */ - /* +-------------+---------------------+------------+ */ - /* | | */ - /* | v */ - /* */ - /* pixel contour contour pixel */ - /* center center */ - - /* drop-out mode scan conversion rules (as defined in OpenType) */ - /* --------------------------------------------------------------- */ - /* 0 1, 2, 3 */ - /* 1 1, 2, 4 */ - /* 2 1, 2 */ - /* 3 same as mode 2 */ - /* 4 1, 2, 5 */ - /* 5 1, 2, 6 */ - /* 6, 7 same as mode 2 */ - - e1 = CEILING( x1 ); - e2 = FLOOR ( x2 ); - pxl = e1; - - if ( e1 > e2 ) - { - Int dropOutControl = left->flags & 7; - - - if ( e1 == e2 + ras.precision ) - { - switch ( dropOutControl ) - { - case 0: /* simple drop-outs including stubs */ - pxl = e2; - break; - - case 4: /* smart drop-outs including stubs */ - pxl = SMART( x1, x2 ); - break; - - case 1: /* simple drop-outs excluding stubs */ - case 5: /* smart drop-outs excluding stubs */ - - /* Drop-out Control Rules #4 and #6 */ - - /* The specification neither provides an exact definition */ - /* of a `stub' nor gives exact rules to exclude them. */ - /* */ - /* Here the constraints we use to recognize a stub. */ - /* */ - /* upper stub: */ - /* */ - /* - P_Left and P_Right are in the same contour */ - /* - P_Right is the successor of P_Left in that contour */ - /* - y is the top of P_Left and P_Right */ - /* */ - /* lower stub: */ - /* */ - /* - P_Left and P_Right are in the same contour */ - /* - P_Left is the successor of P_Right in that contour */ - /* - y is the bottom of P_Left */ - /* */ - /* We draw a stub if the following constraints are met. */ - /* */ - /* - for an upper or lower stub, there is top or bottom */ - /* overshoot, respectively */ - /* - the covered interval is greater or equal to a half */ - /* pixel */ - - /* upper stub test */ - if ( left->next == right && - left->height <= 0 && - !( left->flags & Overshoot_Top && - x2 - x1 >= ras.precision_half ) ) - goto Exit; - - /* lower stub test */ - if ( right->next == left && - left->start == y && - !( left->flags & Overshoot_Bottom && - x2 - x1 >= ras.precision_half ) ) - goto Exit; - - if ( dropOutControl == 1 ) - pxl = e2; - else - pxl = SMART( x1, x2 ); - break; - - default: /* modes 2, 3, 6, 7 */ - goto Exit; /* no drop-out control */ - } + Int e1 = (Int)TRUNC( x1 ); + Int e2 = (Int)TRUNC( x2 ); + Int c1, f1; - /* undocumented but confirmed: If the drop-out would result in a */ - /* pixel outside of the bounding box, use the pixel inside of the */ - /* bounding box instead */ - if ( pxl < 0 ) - pxl = e1; - else if ( TRUNC( pxl ) >= ras.bWidth ) - pxl = e2; + FT_UNUSED( y ); - /* check that the other pixel isn't set */ - e1 = ( pxl == e1 ) ? e2 : e1; - e1 = TRUNC( e1 ); + /* undocumented but confirmed: If the drop-out would result in a */ + /* pixel outside of the bounding box, use the pixel inside of the */ + /* bounding box instead */ + if ( e1 < 0 || e1 > ras.bRight ) + e1 = e2; - c1 = (Short)( e1 >> 3 ); - f1 = (Short)( e1 & 7 ); + /* otherwise check that the other pixel isn't set */ + else if ( e2 >=0 && e2 <= ras.bRight ) + { + c1 = e2 >> 3; + f1 = 0x80 >> ( e2 & 7 ); - if ( e1 >= 0 && e1 < ras.bWidth && - ras.bLine[c1] & ( 0x80 >> f1 ) ) - goto Exit; - } - else - goto Exit; + if ( ras.bLine[c1] & f1 ) + return; } - e1 = TRUNC( pxl ); - - if ( e1 >= 0 && e1 < ras.bWidth ) + if ( e1 >= 0 && e1 <= ras.bRight ) { - FT_TRACE7(( " -> x=%ld", e1 )); + c1 = e1 >> 3; + f1 = 0x80 >> ( e1 & 7 ); - c1 = (Short)( e1 >> 3 ); - f1 = (Short)( e1 & 7 ); + FT_TRACE7(( " y=%d x=%d%s\n", y, e1, + ras.bLine[c1] & f1 ? " redundant" : "" )); - ras.bLine[c1] |= (char)( 0x80 >> f1 ); + ras.bLine[c1] |= f1; } - - Exit: - FT_TRACE7(( " dropout=%d\n", left->flags & 7 )); } static void Vertical_Sweep_Step( RAS_ARG ) { - ras.bLine -= ras.target.pitch; + ras.bLine -= ras.bPitch; } @@ -2450,8 +2103,8 @@ */ static void - Horizontal_Sweep_Init( RAS_ARGS Short min, - Short max ) + Horizontal_Sweep_Init( RAS_ARGS Int min, + Int max ) { /* nothing, really */ FT_UNUSED_RASTER; @@ -2461,22 +2114,18 @@ static void - Horizontal_Sweep_Span( RAS_ARGS Short y, + Horizontal_Sweep_Span( RAS_ARGS Int y, FT_F26Dot6 x1, - FT_F26Dot6 x2, - PProfile left, - PProfile right ) + FT_F26Dot6 x2 ) { - Long e1, e2; + Long e1 = CEILING( x1 ); + Long e2 = FLOOR( x2 ); - FT_UNUSED( left ); - FT_UNUSED( right ); - - FT_TRACE7(( " x=%d y=[% .12f;% .12f]", + FT_TRACE7(( " x=%d y=[% .*f;% .*f]", y, - (double)x1 / (double)ras.precision, - (double)x2 / (double)ras.precision )); + ras.precision_bits, (double)x1 / (double)ras.precision, + ras.precision_bits, (double)x2 / (double)ras.precision )); /* We should not need this procedure but the vertical sweep */ /* mishandles horizontal lines through pixel centers. So we */ @@ -2484,20 +2133,18 @@ /* */ /* XXX: Can we handle horizontal lines better and drop this? */ - e1 = CEILING( x1 ); - if ( x1 == e1 ) { e1 = TRUNC( e1 ); - if ( e1 >= 0 && (ULong)e1 < ras.target.rows ) + if ( e1 >= 0 && e1 <= ras.bTop ) { - Byte f1; + Int f1; PByte bits; - bits = ras.bOrigin + ( y >> 3 ) - e1 * ras.target.pitch; - f1 = (Byte)( 0x80 >> ( y & 7 ) ); + bits = ras.bOrigin + ( y >> 3 ) - e1 * ras.bPitch; + f1 = 0x80 >> ( y & 7 ); FT_TRACE7(( bits[0] & f1 ? " redundant" : " -> y=%ld edge", e1 )); @@ -2506,20 +2153,18 @@ } } - e2 = FLOOR ( x2 ); - if ( x2 == e2 ) { e2 = TRUNC( e2 ); - if ( e2 >= 0 && (ULong)e2 < ras.target.rows ) + if ( e2 >= 0 && e2 <= ras.bTop ) { - Byte f1; + Int f1; PByte bits; - bits = ras.bOrigin + ( y >> 3 ) - e2 * ras.target.pitch; - f1 = (Byte)( 0x80 >> ( y & 7 ) ); + bits = ras.bOrigin + ( y >> 3 ) - e2 * ras.bPitch; + f1 = 0x80 >> ( y & 7 ); FT_TRACE7(( bits[0] & f1 ? " redundant" : " -> y=%ld edge", e2 )); @@ -2533,122 +2178,42 @@ static void - Horizontal_Sweep_Drop( RAS_ARGS Short y, + Horizontal_Sweep_Drop( RAS_ARGS Int y, FT_F26Dot6 x1, - FT_F26Dot6 x2, - PProfile left, - PProfile right ) + FT_F26Dot6 x2 ) { - Long e1, e2, pxl; + Int e1 = (Int)TRUNC( x1 ); + Int e2 = (Int)TRUNC( x2 ); PByte bits; - Byte f1; - - - FT_TRACE7(( " x=%d y=[% .12f;% .12f]", - y, - (double)x1 / (double)ras.precision, - (double)x2 / (double)ras.precision )); - - /* During the horizontal sweep, we only take care of drop-outs */ - - /* e1 + <-- pixel center */ - /* | */ - /* x1 ---+--> <-- contour */ - /* | */ - /* | */ - /* x2 <--+--- <-- contour */ - /* | */ - /* | */ - /* e2 + <-- pixel center */ - - e1 = CEILING( x1 ); - e2 = FLOOR ( x2 ); - pxl = e1; - - if ( e1 > e2 ) - { - Int dropOutControl = left->flags & 7; - + Int f1; - if ( e1 == e2 + ras.precision ) - { - switch ( dropOutControl ) - { - case 0: /* simple drop-outs including stubs */ - pxl = e2; - break; - - case 4: /* smart drop-outs including stubs */ - pxl = SMART( x1, x2 ); - break; - - case 1: /* simple drop-outs excluding stubs */ - case 5: /* smart drop-outs excluding stubs */ - /* see Vertical_Sweep_Drop for details */ - - /* rightmost stub test */ - if ( left->next == right && - left->height <= 0 && - !( left->flags & Overshoot_Top && - x2 - x1 >= ras.precision_half ) ) - goto Exit; - - /* leftmost stub test */ - if ( right->next == left && - left->start == y && - !( left->flags & Overshoot_Bottom && - x2 - x1 >= ras.precision_half ) ) - goto Exit; - - if ( dropOutControl == 1 ) - pxl = e2; - else - pxl = SMART( x1, x2 ); - break; - default: /* modes 2, 3, 6, 7 */ - goto Exit; /* no drop-out control */ - } - - /* undocumented but confirmed: If the drop-out would result in a */ - /* pixel outside of the bounding box, use the pixel inside of the */ - /* bounding box instead */ - if ( pxl < 0 ) - pxl = e1; - else if ( (ULong)( TRUNC( pxl ) ) >= ras.target.rows ) - pxl = e2; - - /* check that the other pixel isn't set */ - e1 = ( pxl == e1 ) ? e2 : e1; - - e1 = TRUNC( e1 ); + /* undocumented but confirmed: If the drop-out would result in a */ + /* pixel outside of the bounding box, use the pixel inside of the */ + /* bounding box instead */ + if ( e1 < 0 || e1 > ras.bTop ) + e1 = e2; - bits = ras.bOrigin + ( y >> 3 ) - e1 * ras.target.pitch; - f1 = (Byte)( 0x80 >> ( y & 7 ) ); + /* otherwise check that the other pixel isn't set */ + else if ( e2 >=0 && e2 <= ras.bTop ) + { + bits = ras.bOrigin + ( y >> 3 ) - e2 * ras.bPitch; + f1 = 0x80 >> ( y & 7 ); - if ( e1 >= 0 && - (ULong)e1 < ras.target.rows && - *bits & f1 ) - goto Exit; - } - else - goto Exit; + if ( *bits & f1 ) + return; } - e1 = TRUNC( pxl ); - - if ( e1 >= 0 && (ULong)e1 < ras.target.rows ) + if ( e1 >= 0 && e1 <= ras.bTop ) { - FT_TRACE7(( " -> y=%ld", e1 )); + bits = ras.bOrigin + ( y >> 3 ) - e1 * ras.bPitch; + f1 = 0x80 >> ( y & 7 ); - bits = ras.bOrigin + ( y >> 3 ) - e1 * ras.target.pitch; - f1 = (Byte)( 0x80 >> ( y & 7 ) ); + FT_TRACE7(( " x=%d y=%d%s\n", y, e1, + *bits & f1 ? " redundant" : "" )); - bits[0] |= f1; + *bits |= f1; } - - Exit: - FT_TRACE7(( " dropout=%d\n", left->flags & 7 )); } @@ -2664,116 +2229,61 @@ * * Generic Sweep Drawing routine * + * Note that this routine is executed with the pool containing at least + * two valid profiles (up and down) and two y-turns (top and bottom). + * */ - static Bool + static void Draw_Sweep( RAS_ARG ) { - Short y, y_change, y_height; - - PProfile P, Q, P_Left, P_Right; - - Short min_Y, max_Y, top, bottom, dropouts; - - Long x1, x2, xs, e1, e2; - - TProfileList waiting; - TProfileList draw_left, draw_right; - - - /* initialize empty linked lists */ - - Init_Linked( &waiting ); - - Init_Linked( &draw_left ); - Init_Linked( &draw_right ); - - /* first, compute min and max Y */ - - P = ras.fProfile; - max_Y = (Short)TRUNC( ras.minY ); - min_Y = (Short)TRUNC( ras.maxY ); - - while ( P ) - { - Q = P->link; + Int min_Y, max_Y, dropouts; + Int y, y_turn; - bottom = (Short)P->start; - top = (Short)( P->start + P->height - 1 ); + PProfile *Q, P, P_Left, P_Right; - if ( min_Y > bottom ) - min_Y = bottom; - if ( max_Y < top ) - max_Y = top; + TProfileList waiting = ras.fProfile; + TProfileList draw_left = NULL; + TProfileList draw_right = NULL; - P->X = 0; - InsNew( &waiting, P ); - P = Q; - } + /* use y_turns to set the drawing range */ - /* check the Y-turns */ - if ( ras.numTurns == 0 ) - { - ras.error = FT_THROW( Invalid_Outline ); - return FAILURE; - } + min_Y = (Int)ras.maxBuff[0]; + max_Y = (Int)ras.maxBuff[ras.numTurns] - 1; /* now initialize the sweep */ ras.Proc_Sweep_Init( RAS_VARS min_Y, max_Y ); - /* then compute the distance of each profile from min_Y */ - - P = waiting; - - while ( P ) - { - P->countL = P->start - min_Y; - P = P->link; - } - /* let's go */ - y = min_Y; - y_height = 0; - - if ( ras.numTurns > 0 && - ras.sizeBuff[-ras.numTurns] == min_Y ) - ras.numTurns--; - - while ( ras.numTurns > 0 ) + for ( y = min_Y; y <= max_Y; ) { - /* check waiting list for new activations */ - - P = waiting; + /* check waiting list for new profile activations */ - while ( P ) + Q = &waiting; + while ( *Q ) { - Q = P->link; - P->countL -= y_height; - if ( P->countL == 0 ) + P = *Q; + if ( P->start == y ) { - DelOld( &waiting, P ); + *Q = P->link; /* remove */ + /* each active list contains profiles with the same flow */ + /* left and right are arbitrary, correspond to TrueType */ if ( P->flags & Flow_Up ) InsNew( &draw_left, P ); else InsNew( &draw_right, P ); } - - P = Q; + else + Q = &P->link; } - /* sort the drawing lists */ + y_turn = (Int)*++ras.maxBuff; - Sort( &draw_left ); - Sort( &draw_right ); - - y_change = (Short)ras.sizeBuff[-ras.numTurns--]; - y_height = (Short)( y_change - y ); - - while ( y < y_change ) + do { /* let's trace */ @@ -2784,9 +2294,13 @@ while ( P_Left && P_Right ) { - x1 = P_Left ->X; - x2 = P_Right->X; + Long x1 = P_Left ->X; + Long x2 = P_Right->X; + Long xs; + + /* TrueType should have x2 > x1, but can be opposite */ + /* by mistake or in CFF/Type1, fix it then */ if ( x1 > x2 ) { xs = x1; @@ -2794,205 +2308,130 @@ x2 = xs; } - e1 = FLOOR( x1 ); - e2 = CEILING( x2 ); + if ( CEILING( x1 ) <= FLOOR( x2 ) ) + ras.Proc_Sweep_Span( RAS_VARS y, x1, x2 ); - if ( x2 - x1 <= ras.precision && - e1 != x1 && e2 != x2 ) + /* otherwise, bottom ceiling > top floor, it is a drop-out */ + else { - if ( e1 > e2 || e2 == e1 + ras.precision ) + Int dropOutControl = P_Left->flags & 7; + + + /* Drop-out control */ + + /* e2 x2 x1 e1 */ + /* */ + /* ^ | */ + /* | | */ + /* +-------------+---------------------+------------+ */ + /* | | */ + /* | v */ + /* */ + /* pixel contour contour pixel */ + /* center center */ + + /* drop-out mode scan conversion rules (OpenType specs) */ + /* ------------------------------------------------------- */ + /* bit 0 exclude stubs if set */ + /* bit 1 ignore drop-outs if set */ + /* bit 2 smart rounding if set */ + + if ( dropOutControl & 2 ) + goto Next_Pair; + + /* The specification neither provides an exact definition */ + /* of a `stub' nor gives exact rules to exclude them. */ + /* */ + /* Here the constraints we use to recognize a stub. */ + /* */ + /* upper stub: */ + /* */ + /* - P_Left and P_Right are in the same contour */ + /* - P_Right is the successor of P_Left in that contour */ + /* - y is the top of P_Left and P_Right */ + /* */ + /* lower stub: */ + /* */ + /* - P_Left and P_Right are in the same contour */ + /* - P_Left is the successor of P_Right in that contour */ + /* - y is the bottom of P_Left */ + /* */ + /* We draw a stub if the following constraints are met. */ + /* */ + /* - for an upper or lower stub, there is top or bottom */ + /* overshoot, respectively */ + /* - the covered interval is greater or equal to a half */ + /* pixel */ + + if ( dropOutControl & 1 ) { - Int dropOutControl = P_Left->flags & 7; - - - if ( dropOutControl != 2 ) - { - /* a drop-out was detected */ - - P_Left ->X = x1; - P_Right->X = x2; - - /* mark profile for drop-out processing */ - P_Left->countL = 1; - dropouts++; - } + /* upper stub test */ + if ( P_Left->height == 1 && + P_Left->next == P_Right && + !( P_Left->flags & Overshoot_Top && + x2 - x1 >= ras.precision_half ) ) + goto Next_Pair; + + /* lower stub test */ + if ( P_Left->offset == 0 && + P_Right->next == P_Left && + !( P_Left->flags & Overshoot_Bottom && + x2 - x1 >= ras.precision_half ) ) + goto Next_Pair; + } - goto Skip_To_Next; + /* select the pixel to set and the other pixel */ + if ( dropOutControl & 4 ) + { + x2 = SMART( x1, x2 ); + x1 = x1 > x2 ? x2 + ras.precision : x2 - ras.precision; + } + else + { + x2 = FLOOR ( x2 ); + x1 = CEILING( x1 ); } - } - ras.Proc_Sweep_Span( RAS_VARS y, x1, x2, P_Left, P_Right ); + P_Left ->X = x2; + P_Right->X = x1; - Skip_To_Next: + /* mark profile for drop-out processing */ + P_Left->flags |= Dropout; + dropouts++; + } + Next_Pair: P_Left = P_Left->link; P_Right = P_Right->link; } - /* handle drop-outs _after_ the span drawing -- */ - /* drop-out processing has been moved out of the loop */ - /* for performance tuning */ - if ( dropouts > 0 ) - goto Scan_DropOuts; - - Next_Line: - - ras.Proc_Sweep_Step( RAS_VAR ); - - y++; + /* handle drop-outs _after_ the span drawing */ + P_Left = draw_left; + P_Right = draw_right; - if ( y < y_change ) + while ( dropouts ) { - Sort( &draw_left ); - Sort( &draw_right ); - } - } - - /* now finalize the profiles that need it */ - - P = draw_left; - while ( P ) - { - Q = P->link; - if ( P->height == 0 ) - DelOld( &draw_left, P ); - P = Q; - } - - P = draw_right; - while ( P ) - { - Q = P->link; - if ( P->height == 0 ) - DelOld( &draw_right, P ); - P = Q; - } - } - - /* for gray-scaling, flush the bitmap scanline cache */ - while ( y <= max_Y ) - { - ras.Proc_Sweep_Step( RAS_VAR ); - y++; - } - - return SUCCESS; - - Scan_DropOuts: - - P_Left = draw_left; - P_Right = draw_right; - - while ( P_Left && P_Right ) - { - if ( P_Left->countL ) - { - P_Left->countL = 0; -#if 0 - dropouts--; /* -- this is useful when debugging only */ -#endif - ras.Proc_Sweep_Drop( RAS_VARS y, - P_Left->X, - P_Right->X, - P_Left, - P_Right ); - } - - P_Left = P_Left->link; - P_Right = P_Right->link; - } - - goto Next_Line; - } - - -#ifdef STANDALONE_ - - /************************************************************************** - * - * The following functions should only compile in stand-alone mode, - * i.e., when building this component without the rest of FreeType. - * - */ - - /************************************************************************** - * - * @Function: - * FT_Outline_Get_CBox - * - * @Description: - * Return an outline's `control box'. The control box encloses all - * the outline's points, including Bézier control points. Though it - * coincides with the exact bounding box for most glyphs, it can be - * slightly larger in some situations (like when rotating an outline - * that contains Bézier outside arcs). - * - * Computing the control box is very fast, while getting the bounding - * box can take much more time as it needs to walk over all segments - * and arcs in the outline. To get the latter, you can use the - * `ftbbox' component, which is dedicated to this single task. - * - * @Input: - * outline :: - * A pointer to the source outline descriptor. - * - * @Output: - * acbox :: - * The outline's control box. - * - * @Note: - * See @FT_Glyph_Get_CBox for a discussion of tricky fonts. - */ - - static void - FT_Outline_Get_CBox( const FT_Outline* outline, - FT_BBox *acbox ) - { - if ( outline && acbox ) - { - Long xMin, yMin, xMax, yMax; - - - if ( outline->n_points == 0 ) - { - xMin = 0; - yMin = 0; - xMax = 0; - yMax = 0; - } - else - { - FT_Vector* vec = outline->points; - FT_Vector* limit = vec + outline->n_points; - - - xMin = xMax = vec->x; - yMin = yMax = vec->y; - vec++; + if ( P_Left->flags & Dropout ) + { + ras.Proc_Sweep_Drop( RAS_VARS y, P_Left->X, P_Right->X ); - for ( ; vec < limit; vec++ ) - { - Long x, y; + P_Left->flags &= ~Dropout; + dropouts--; + } + P_Left = P_Left->link; + P_Right = P_Right->link; + } - x = vec->x; - if ( x < xMin ) xMin = x; - if ( x > xMax ) xMax = x; + ras.Proc_Sweep_Step( RAS_VAR ); - y = vec->y; - if ( y < yMin ) yMin = y; - if ( y > yMax ) yMax = y; - } + Increment( &draw_left, 1 ); + Increment( &draw_right, -1 ); } - acbox->xMin = xMin; - acbox->xMax = xMax; - acbox->yMin = yMin; - acbox->yMax = yMax; + while ( ++y < y_turn ); } } -#endif /* STANDALONE_ */ - /************************************************************************** * @@ -3019,13 +2458,15 @@ Int band_stack[32]; /* enough to bisect 32-bit int bands */ + FT_TRACE6(( "%s pass [%d..%d]\n", + flipped ? "Horizontal" : "Vertical", + y_min, y_max )); + while ( 1 ) { ras.minY = (Long)y_min * ras.precision; ras.maxY = (Long)y_max * ras.precision; - ras.top = ras.buff; - ras.error = Raster_Err_Ok; if ( Convert_Glyph( RAS_VARS flipped ) ) @@ -3038,6 +2479,9 @@ if ( y_min == y_max ) return ras.error; /* still Raster_Overflow */ + FT_TRACE6(( "band [%d..%d]: to be bisected\n", + y_min, y_max )); + y_mid = ( y_min + y_max ) >> 1; band_stack[band_top++] = y_min; @@ -3045,9 +2489,12 @@ } else { + FT_TRACE6(( "band [%d..%d]: %hd profiles; %td bytes remaining\n", + y_min, y_max, ras.num_Profs, + (char*)ras.maxBuff - (char*)ras.top )); + if ( ras.fProfile ) - if ( Draw_Sweep( RAS_VAR ) ) - return ras.error; + Draw_Sweep( RAS_VAR ); if ( --band_top < 0 ) break; @@ -3076,53 +2523,48 @@ Render_Glyph( RAS_ARG ) { FT_Error error; + Long buffer[FT_MAX_BLACK_POOL]; + ras.buff = buffer; + ras.sizeBuff = (&buffer)[1]; /* Points to right after buffer. */ + Set_High_Precision( RAS_VARS ras.outline.flags & FT_OUTLINE_HIGH_PRECISION ); + ras.dropOutControl = 0; + if ( ras.outline.flags & FT_OUTLINE_IGNORE_DROPOUTS ) - ras.dropOutControl = 2; - else - { - if ( ras.outline.flags & FT_OUTLINE_SMART_DROPOUTS ) - ras.dropOutControl = 4; - else - ras.dropOutControl = 0; + ras.dropOutControl |= 2; - if ( !( ras.outline.flags & FT_OUTLINE_INCLUDE_STUBS ) ) - ras.dropOutControl += 1; - } + if ( ras.outline.flags & FT_OUTLINE_SMART_DROPOUTS ) + ras.dropOutControl |= 4; - /* Vertical Sweep */ - FT_TRACE7(( "Vertical pass (ftraster)\n" )); + if ( !( ras.outline.flags & FT_OUTLINE_INCLUDE_STUBS ) ) + ras.dropOutControl |= 1; + + FT_TRACE6(( "BW Raster: precision 1/%d, dropout mode %d\n", + ras.precision, ras.dropOutControl )); + /* Vertical Sweep */ ras.Proc_Sweep_Init = Vertical_Sweep_Init; ras.Proc_Sweep_Span = Vertical_Sweep_Span; ras.Proc_Sweep_Drop = Vertical_Sweep_Drop; ras.Proc_Sweep_Step = Vertical_Sweep_Step; - ras.bWidth = (UShort)ras.target.width; - ras.bOrigin = (Byte*)ras.target.buffer; - - if ( ras.target.pitch > 0 ) - ras.bOrigin += (Long)( ras.target.rows - 1 ) * ras.target.pitch; - - error = Render_Single_Pass( RAS_VARS 0, 0, (Int)ras.target.rows - 1 ); + error = Render_Single_Pass( RAS_VARS 0, 0, ras.bTop ); if ( error ) return error; /* Horizontal Sweep */ if ( !( ras.outline.flags & FT_OUTLINE_SINGLE_PASS ) ) { - FT_TRACE7(( "Horizontal pass (ftraster)\n" )); - ras.Proc_Sweep_Init = Horizontal_Sweep_Init; ras.Proc_Sweep_Span = Horizontal_Sweep_Span; ras.Proc_Sweep_Drop = Horizontal_Sweep_Drop; ras.Proc_Sweep_Step = Horizontal_Sweep_Step; - error = Render_Single_Pass( RAS_VARS 1, 0, (Int)ras.target.width - 1 ); + error = Render_Single_Pass( RAS_VARS 1, 0, ras.bRight ); if ( error ) return error; } @@ -3233,8 +2675,6 @@ black_TWorker worker[1]; #endif - Long buffer[FT_MAX_BLACK_POOL]; - if ( !raster ) return FT_THROW( Raster_Uninitialized ); @@ -3243,7 +2683,7 @@ return FT_THROW( Invalid_Outline ); /* return immediately if the outline is empty */ - if ( outline->n_points == 0 || outline->n_contours <= 0 ) + if ( outline->n_points == 0 || outline->n_contours == 0 ) return Raster_Err_Ok; if ( !outline->contours || !outline->points ) @@ -3269,10 +2709,14 @@ return FT_THROW( Invalid_Argument ); ras.outline = *outline; - ras.target = *target_map; - ras.buff = buffer; - ras.sizeBuff = (&buffer)[1]; /* Points to right after buffer. */ + ras.bTop = (Int)target_map->rows - 1; + ras.bRight = (Int)target_map->width - 1; + ras.bPitch = (Int)target_map->pitch; + ras.bOrigin = (PByte)target_map->buffer; + + if ( ras.bPitch > 0 ) + ras.bOrigin += ras.bTop * ras.bPitch; return Render_Glyph( RAS_VAR ); } diff --git a/vendor/freetype/src/raster/ftraster.h b/vendor/freetype/src/raster/ftraster.h index b511b3a99e..ad9cb1b9fe 100644 --- a/vendor/freetype/src/raster/ftraster.h +++ b/vendor/freetype/src/raster/ftraster.h @@ -4,7 +4,7 @@ * * The FreeType glyph rasterizer (specification). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used diff --git a/vendor/freetype/src/raster/ftrend1.c b/vendor/freetype/src/raster/ftrend1.c index 6d442b1ff8..fd9f174f2e 100644 --- a/vendor/freetype/src/raster/ftrend1.c +++ b/vendor/freetype/src/raster/ftrend1.c @@ -4,7 +4,7 @@ * * The FreeType glyph rasterizer interface (body). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/raster/ftrend1.h b/vendor/freetype/src/raster/ftrend1.h index cec35c8528..cf3e73c0a2 100644 --- a/vendor/freetype/src/raster/ftrend1.h +++ b/vendor/freetype/src/raster/ftrend1.h @@ -4,7 +4,7 @@ * * The FreeType glyph rasterizer interface (specification). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/raster/raster.c b/vendor/freetype/src/raster/raster.c index 82f474547d..fe33af2423 100644 --- a/vendor/freetype/src/raster/raster.c +++ b/vendor/freetype/src/raster/raster.c @@ -4,7 +4,7 @@ * * FreeType monochrome rasterer module component (body only). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/raster/rasterrs.h b/vendor/freetype/src/raster/rasterrs.h index 989d8b44be..326d42e043 100644 --- a/vendor/freetype/src/raster/rasterrs.h +++ b/vendor/freetype/src/raster/rasterrs.h @@ -4,7 +4,7 @@ * * monochrome renderer error codes (specification only). * - * Copyright (C) 2001-2023 by + * Copyright (C) 2001-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/sdf/ftbsdf.c b/vendor/freetype/src/sdf/ftbsdf.c index e472738339..adde05ba19 100644 --- a/vendor/freetype/src/sdf/ftbsdf.c +++ b/vendor/freetype/src/sdf/ftbsdf.c @@ -4,7 +4,7 @@ * * Signed Distance Field support for bitmap fonts (body only). * - * Copyright (C) 2020-2023 by + * Copyright (C) 2020-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * Written by Anuj Verma. diff --git a/vendor/freetype/src/sdf/ftsdf.c b/vendor/freetype/src/sdf/ftsdf.c index bc4625d984..dc55d42630 100644 --- a/vendor/freetype/src/sdf/ftsdf.c +++ b/vendor/freetype/src/sdf/ftsdf.c @@ -4,7 +4,7 @@ * * Signed Distance Field support for outline fonts (body). * - * Copyright (C) 2020-2023 by + * Copyright (C) 2020-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * Written by Anuj Verma. @@ -3837,7 +3837,7 @@ } /* if the outline is empty, return */ - if ( outline->n_points <= 0 || outline->n_contours <= 0 ) + if ( outline->n_points == 0 || outline->n_contours == 0 ) goto Exit; /* check whether the outline has valid fields */ diff --git a/vendor/freetype/src/sdf/ftsdf.h b/vendor/freetype/src/sdf/ftsdf.h index 234c075b0a..25a0a13bb8 100644 --- a/vendor/freetype/src/sdf/ftsdf.h +++ b/vendor/freetype/src/sdf/ftsdf.h @@ -4,7 +4,7 @@ * * Signed Distance Field support (specification). * - * Copyright (C) 2020-2023 by + * Copyright (C) 2020-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * Written by Anuj Verma. diff --git a/vendor/freetype/src/sdf/ftsdfcommon.c b/vendor/freetype/src/sdf/ftsdfcommon.c index 5052201e22..6b2cf7dfec 100644 --- a/vendor/freetype/src/sdf/ftsdfcommon.c +++ b/vendor/freetype/src/sdf/ftsdfcommon.c @@ -4,7 +4,7 @@ * * Auxiliary data for Signed Distance Field support (body). * - * Copyright (C) 2020-2023 by + * Copyright (C) 2020-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * Written by Anuj Verma. @@ -22,49 +22,6 @@ #include "ftsdfcommon.h" - /************************************************************************** - * - * common functions - * - */ - - /* - * Original algorithm: - * - * https://github.com/chmike/fpsqrt - * - * Use this to compute the square root of a 16.16 fixed-point number. - */ - FT_LOCAL_DEF( FT_16D16 ) - square_root( FT_16D16 val ) - { - FT_ULong t, q, b, r; - - - r = (FT_ULong)val; - b = 0x40000000L; - q = 0; - - while ( b > 0x40L ) - { - t = q + b; - - if ( r >= t ) - { - r -= t; - q = t + b; - } - - r <<= 1; - b >>= 1; - } - - q >>= 8; - - return (FT_16D16)q; - } - - /************************************************************************** * * format and sign manipulating functions diff --git a/vendor/freetype/src/sdf/ftsdfcommon.h b/vendor/freetype/src/sdf/ftsdfcommon.h index 60ca9773e3..d0f623f9f3 100644 --- a/vendor/freetype/src/sdf/ftsdfcommon.h +++ b/vendor/freetype/src/sdf/ftsdfcommon.h @@ -4,7 +4,7 @@ * * Auxiliary data for Signed Distance Field support (specification). * - * Copyright (C) 2020-2023 by + * Copyright (C) 2020-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * Written by Anuj Verma. @@ -122,8 +122,7 @@ FT_BEGIN_HEADER typedef FT_BBox FT_CBox; /* control box of a curve */ - FT_LOCAL( FT_16D16 ) - square_root( FT_16D16 val ); +#define square_root( x ) (FT_16D16)FT_SqrtFixed( (FT_UInt32)( x ) ) FT_LOCAL( FT_SDFFormat ) map_fixed_to_sdf( FT_16D16 dist, diff --git a/vendor/freetype/src/sdf/ftsdferrs.h b/vendor/freetype/src/sdf/ftsdferrs.h index 519db0fc26..5af873fafb 100644 --- a/vendor/freetype/src/sdf/ftsdferrs.h +++ b/vendor/freetype/src/sdf/ftsdferrs.h @@ -4,7 +4,7 @@ * * Signed Distance Field error codes (specification only). * - * Copyright (C) 2020-2023 by + * Copyright (C) 2020-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * Written by Anuj Verma. diff --git a/vendor/freetype/src/sdf/ftsdfrend.c b/vendor/freetype/src/sdf/ftsdfrend.c index 5610c119f8..d3324678d6 100644 --- a/vendor/freetype/src/sdf/ftsdfrend.c +++ b/vendor/freetype/src/sdf/ftsdfrend.c @@ -4,7 +4,7 @@ * * Signed Distance Field renderer interface (body). * - * Copyright (C) 2020-2023 by + * Copyright (C) 2020-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * Written by Anuj Verma. diff --git a/vendor/freetype/src/sdf/ftsdfrend.h b/vendor/freetype/src/sdf/ftsdfrend.h index 571ac833d3..2ea6f86819 100644 --- a/vendor/freetype/src/sdf/ftsdfrend.h +++ b/vendor/freetype/src/sdf/ftsdfrend.h @@ -4,7 +4,7 @@ * * Signed Distance Field renderer interface (specification). * - * Copyright (C) 2020-2023 by + * Copyright (C) 2020-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * Written by Anuj Verma. diff --git a/vendor/freetype/src/sdf/sdf.c b/vendor/freetype/src/sdf/sdf.c index c159b08128..6045b8330b 100644 --- a/vendor/freetype/src/sdf/sdf.c +++ b/vendor/freetype/src/sdf/sdf.c @@ -4,7 +4,7 @@ * * FreeType Signed Distance Field renderer module component (body only). * - * Copyright (C) 2020-2023 by + * Copyright (C) 2020-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * Written by Anuj Verma. diff --git a/vendor/freetype/src/sfnt/pngshim.c b/vendor/freetype/src/sfnt/pngshim.c index 33712162e0..76181568af 100644 --- a/vendor/freetype/src/sfnt/pngshim.c +++ b/vendor/freetype/src/sfnt/pngshim.c @@ -4,7 +4,7 @@ * * PNG Bitmap glyph support. * - * Copyright (C) 2013-2023 by + * Copyright (C) 2013-2024 by * Google, Inc. * Written by Stuart Gill and Behdad Esfahbod. * diff --git a/vendor/freetype/src/sfnt/pngshim.h b/vendor/freetype/src/sfnt/pngshim.h index 903bd2bc34..6e7a5c08e7 100644 --- a/vendor/freetype/src/sfnt/pngshim.h +++ b/vendor/freetype/src/sfnt/pngshim.h @@ -4,7 +4,7 @@ * * PNG Bitmap glyph support. * - * Copyright (C) 2013-2023 by + * Copyright (C) 2013-2024 by * Google, Inc. * Written by Stuart Gill and Behdad Esfahbod. * diff --git a/vendor/freetype/src/sfnt/sfdriver.c b/vendor/freetype/src/sfnt/sfdriver.c index 0925940b03..81072207b4 100644 --- a/vendor/freetype/src/sfnt/sfdriver.c +++ b/vendor/freetype/src/sfnt/sfdriver.c @@ -4,7 +4,7 @@ * * High-level SFNT driver interface (body). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -49,6 +49,10 @@ #include #endif +#ifdef TT_CONFIG_OPTION_GPOS_KERNING +#include "ttgpos.h" +#endif + #include "ttcmap.h" #include "ttkern.h" #include "ttmtx.h" @@ -1249,6 +1253,12 @@ #define PUT_PS_NAMES( a ) a #else #define PUT_PS_NAMES( a ) NULL +#endif + +#ifdef TT_CONFIG_OPTION_GPOS_KERNING +#define PUT_GPOS_KERNING( a ) a +#else +#define PUT_GPOS_KERNING( a ) NULL #endif FT_DEFINE_SFNT_INTERFACE( @@ -1274,6 +1284,8 @@ tt_face_free_name, /* TT_Free_Table_Func free_name */ tt_face_load_kern, /* TT_Load_Table_Func load_kern */ + PUT_GPOS_KERNING( tt_face_load_gpos ), + /* TT_Load_Table_Func load_gpos */ tt_face_load_gasp, /* TT_Load_Table_Func load_gasp */ tt_face_load_pclt, /* TT_Load_Table_Func load_init */ @@ -1292,6 +1304,9 @@ /* since version 2.1.8 */ tt_face_get_kerning, /* TT_Face_GetKerningFunc get_kerning */ + PUT_GPOS_KERNING( tt_face_get_gpos_kerning ), + /* TT_Face_GetKerningFunc get_gpos_kerning */ + /* since version 2.2 */ tt_face_load_font_dir, /* TT_Load_Table_Func load_font_dir */ tt_face_load_hmtx, /* TT_Load_Metrics_Func load_hmtx */ diff --git a/vendor/freetype/src/sfnt/sfdriver.h b/vendor/freetype/src/sfnt/sfdriver.h index 2445958b69..6f71489fdc 100644 --- a/vendor/freetype/src/sfnt/sfdriver.h +++ b/vendor/freetype/src/sfnt/sfdriver.h @@ -4,7 +4,7 @@ * * High-level SFNT driver interface (specification). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/sfnt/sferrors.h b/vendor/freetype/src/sfnt/sferrors.h index e7a8eb04bb..d3ca1d9aa8 100644 --- a/vendor/freetype/src/sfnt/sferrors.h +++ b/vendor/freetype/src/sfnt/sferrors.h @@ -4,7 +4,7 @@ * * SFNT error codes (specification only). * - * Copyright (C) 2001-2023 by + * Copyright (C) 2001-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/sfnt/sfnt.c b/vendor/freetype/src/sfnt/sfnt.c index 8e4f08a90c..52411febc4 100644 --- a/vendor/freetype/src/sfnt/sfnt.c +++ b/vendor/freetype/src/sfnt/sfnt.c @@ -4,7 +4,7 @@ * * Single object library component. * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -29,6 +29,7 @@ #include "ttcpal.c" #include "ttsvg.c" +#include "ttgpos.c" #include "ttkern.c" #include "ttload.c" #include "ttmtx.c" diff --git a/vendor/freetype/src/sfnt/sfobjs.c b/vendor/freetype/src/sfnt/sfobjs.c index f5d66ef840..6ee4e5e939 100644 --- a/vendor/freetype/src/sfnt/sfobjs.c +++ b/vendor/freetype/src/sfnt/sfobjs.c @@ -4,7 +4,7 @@ * * SFNT object management (base). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -40,6 +40,10 @@ #include "ttbdf.h" #endif +#ifdef TT_CONFIG_OPTION_GPOS_KERNING +#include "ttgpos.h" +#endif + /************************************************************************** * @@ -1026,6 +1030,10 @@ LOAD_( gasp ); LOAD_( kern ); +#ifdef TT_CONFIG_OPTION_GPOS_KERNING + LOAD_( gpos ); +#endif + face->root.num_glyphs = face->max_profile.numGlyphs; /* Bit 8 of the `fsSelection' field in the `OS/2' table denotes */ @@ -1119,7 +1127,11 @@ flags |= FT_FACE_FLAG_VERTICAL; /* kerning available ? */ - if ( TT_FACE_HAS_KERNING( face ) ) + if ( TT_FACE_HAS_KERNING( face ) +#ifdef TT_CONFIG_OPTION_GPOS_KERNING + || face->gpos_kerning_available +#endif + ) flags |= FT_FACE_FLAG_KERNING; #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT @@ -1470,6 +1482,11 @@ /* freeing the kerning table */ tt_face_done_kern( face ); +#ifdef TT_CONFIG_OPTION_GPOS_KERNING + /* freeing the GPOS table */ + tt_face_done_gpos( face ); +#endif + /* freeing the collection table */ FT_FREE( face->ttc_header.offsets ); face->ttc_header.count = 0; diff --git a/vendor/freetype/src/sfnt/sfobjs.h b/vendor/freetype/src/sfnt/sfobjs.h index 906aebbf90..90847d9573 100644 --- a/vendor/freetype/src/sfnt/sfobjs.h +++ b/vendor/freetype/src/sfnt/sfobjs.h @@ -4,7 +4,7 @@ * * SFNT object management (specification). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/sfnt/sfwoff.c b/vendor/freetype/src/sfnt/sfwoff.c index 7c0ce2205e..14514bf957 100644 --- a/vendor/freetype/src/sfnt/sfwoff.c +++ b/vendor/freetype/src/sfnt/sfwoff.c @@ -4,7 +4,7 @@ * * WOFF format management (base). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -18,6 +18,7 @@ #include "sfwoff.h" #include +#include #include #include #include @@ -149,6 +150,7 @@ /* Miscellaneous checks. */ if ( woff.length != stream->size || woff.num_tables == 0 || + woff.num_tables > 0xFFFU || 44 + woff.num_tables * 20UL >= woff.length || 12 + woff.num_tables * 16UL >= woff.totalSfntSize || ( woff.totalSfntSize & 3 ) != 0 || @@ -169,21 +171,11 @@ /* Write sfnt header. */ { - FT_UInt searchRange, entrySelector, rangeShift, x; + FT_Int entrySelector = FT_MSB( woff.num_tables ); + FT_Int searchRange = ( 1 << entrySelector ) * 16; + FT_Int rangeShift = woff.num_tables * 16 - searchRange; - x = woff.num_tables; - entrySelector = 0; - while ( x ) - { - x >>= 1; - entrySelector += 1; - } - entrySelector--; - - searchRange = ( 1 << entrySelector ) * 16; - rangeShift = woff.num_tables * 16 - searchRange; - WRITE_ULONG ( sfnt_header, woff.flavor ); WRITE_USHORT( sfnt_header, woff.num_tables ); WRITE_USHORT( sfnt_header, searchRange ); diff --git a/vendor/freetype/src/sfnt/sfwoff.h b/vendor/freetype/src/sfnt/sfwoff.h index d438422737..a04735ffe2 100644 --- a/vendor/freetype/src/sfnt/sfwoff.h +++ b/vendor/freetype/src/sfnt/sfwoff.h @@ -4,7 +4,7 @@ * * WOFFF format management (specification). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/sfnt/sfwoff2.c b/vendor/freetype/src/sfnt/sfwoff2.c index 2be44a347a..589b3e0c6b 100644 --- a/vendor/freetype/src/sfnt/sfwoff2.c +++ b/vendor/freetype/src/sfnt/sfwoff2.c @@ -4,7 +4,7 @@ * * WOFF2 format management (base). * - * Copyright (C) 2019-2023 by + * Copyright (C) 2019-2024 by * Nikhil Ramakrishnan, David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -18,6 +18,7 @@ #include "sfwoff2.h" #include "woff2tags.h" #include +#include #include #include @@ -289,23 +290,15 @@ FT_ULong checksum = 0; FT_ULong aligned_size = size & ~3UL; FT_ULong i; - FT_ULong v; + FT_Int shift; for ( i = 0; i < aligned_size; i += 4 ) - checksum += ( (FT_ULong)buf[i ] << 24 ) | - ( (FT_ULong)buf[i + 1] << 16 ) | - ( (FT_ULong)buf[i + 2] << 8 ) | - ( (FT_ULong)buf[i + 3] << 0 ); + checksum += FT_NEXT_ULONG( buf ); - /* If size is not aligned to 4, treat as if it is padded with 0s. */ - if ( size != aligned_size ) - { - v = 0; - for ( i = aligned_size ; i < size; ++i ) - v |= (FT_ULong)buf[i] << ( 24 - 8 * ( i & 3 ) ); - checksum += v; - } + /* remaining bytes can be shifted and added one at a time */ + for ( shift = 24; i < size; i++, shift -= 8 ) + checksum += (FT_UInt32)FT_NEXT_BYTE( buf ) << shift; return checksum; } @@ -1799,7 +1792,6 @@ FT_Byte* sfnt = NULL; FT_Stream sfnt_stream = NULL; - FT_Byte* sfnt_header; FT_ULong sfnt_size; FT_Byte* uncompressed_buf = NULL; @@ -1853,6 +1845,7 @@ /* Miscellaneous checks. */ if ( woff2.length != stream->size || woff2.num_tables == 0 || + woff2.num_tables > 0xFFFU || 48 + woff2.num_tables * 20UL >= woff2.length || ( woff2.metaOffset == 0 && ( woff2.metaLength != 0 || woff2.metaOrigLength != 0 ) ) || @@ -2143,6 +2136,13 @@ WOFF2_TtcFont ttc_font = woff2.ttc_fonts + face_index; + if ( ttc_font->num_tables == 0 || ttc_font->num_tables > 0xFFFU ) + { + FT_ERROR(( "woff2_open_font: invalid WOFF2 CollectionFontEntry\n" )); + error = FT_THROW( Invalid_Table ); + goto Exit; + } + /* Create a temporary array. */ if ( FT_QNEW_ARRAY( temp_indices, ttc_font->num_tables ) ) @@ -2198,27 +2198,15 @@ FT_NEW( sfnt_stream ) ) goto Exit; - sfnt_header = sfnt; - - WRITE_ULONG( sfnt_header, woff2.flavor ); - - if ( woff2.num_tables ) { - FT_UInt searchRange, entrySelector, rangeShift, x; + FT_Byte* sfnt_header = sfnt; + FT_Int entrySelector = FT_MSB( woff2.num_tables ); + FT_Int searchRange = ( 1 << entrySelector ) * 16; + FT_Int rangeShift = woff2.num_tables * 16 - searchRange; - x = woff2.num_tables; - entrySelector = 0; - while ( x ) - { - x >>= 1; - entrySelector += 1; - } - entrySelector--; - - searchRange = ( 1 << entrySelector ) * 16; - rangeShift = ( woff2.num_tables * 16 ) - searchRange; + WRITE_ULONG ( sfnt_header, woff2.flavor ); WRITE_USHORT( sfnt_header, woff2.num_tables ); WRITE_USHORT( sfnt_header, searchRange ); WRITE_USHORT( sfnt_header, entrySelector ); diff --git a/vendor/freetype/src/sfnt/sfwoff2.h b/vendor/freetype/src/sfnt/sfwoff2.h index 4901286ee0..f41140648d 100644 --- a/vendor/freetype/src/sfnt/sfwoff2.h +++ b/vendor/freetype/src/sfnt/sfwoff2.h @@ -4,7 +4,7 @@ * * WOFFF2 format management (specification). * - * Copyright (C) 2019-2023 by + * Copyright (C) 2019-2024 by * Nikhil Ramakrishnan, David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/sfnt/ttbdf.c b/vendor/freetype/src/sfnt/ttbdf.c index 536fa7467e..6138fc46d5 100644 --- a/vendor/freetype/src/sfnt/ttbdf.c +++ b/vendor/freetype/src/sfnt/ttbdf.c @@ -4,7 +4,7 @@ * * TrueType and OpenType embedded BDF properties (body). * - * Copyright (C) 2005-2023 by + * Copyright (C) 2005-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/sfnt/ttbdf.h b/vendor/freetype/src/sfnt/ttbdf.h index 0d7a0acecc..d8d722b928 100644 --- a/vendor/freetype/src/sfnt/ttbdf.h +++ b/vendor/freetype/src/sfnt/ttbdf.h @@ -4,7 +4,7 @@ * * TrueType and OpenType embedded BDF properties (specification). * - * Copyright (C) 2005-2023 by + * Copyright (C) 2005-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/sfnt/ttcmap.c b/vendor/freetype/src/sfnt/ttcmap.c index 9ba25dcbc1..28f4d1173c 100644 --- a/vendor/freetype/src/sfnt/ttcmap.c +++ b/vendor/freetype/src/sfnt/ttcmap.c @@ -4,7 +4,7 @@ * * TrueType character mapping table (cmap) support (body). * - * Copyright (C) 2002-2023 by + * Copyright (C) 2002-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/sfnt/ttcmap.h b/vendor/freetype/src/sfnt/ttcmap.h index ff52917ed5..e2c5e72bf0 100644 --- a/vendor/freetype/src/sfnt/ttcmap.h +++ b/vendor/freetype/src/sfnt/ttcmap.h @@ -4,7 +4,7 @@ * * TrueType character mapping table (cmap) support (specification). * - * Copyright (C) 2002-2023 by + * Copyright (C) 2002-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/sfnt/ttcmapc.h b/vendor/freetype/src/sfnt/ttcmapc.h index 0af48c2478..370898363f 100644 --- a/vendor/freetype/src/sfnt/ttcmapc.h +++ b/vendor/freetype/src/sfnt/ttcmapc.h @@ -4,7 +4,7 @@ * * TT CMAP classes definitions (specification only). * - * Copyright (C) 2009-2023 by + * Copyright (C) 2009-2024 by * Oran Agra and Mickey Gabel. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/sfnt/ttcolr.c b/vendor/freetype/src/sfnt/ttcolr.c index 281e7135ee..b37658dde9 100644 --- a/vendor/freetype/src/sfnt/ttcolr.c +++ b/vendor/freetype/src/sfnt/ttcolr.c @@ -4,7 +4,7 @@ * * TrueType and OpenType colored glyph layer support (body). * - * Copyright (C) 2018-2023 by + * Copyright (C) 2018-2024 by * David Turner, Robert Wilhelm, Dominik Röttsches, and Werner Lemberg. * * Originally written by Shao Yu Zhang . @@ -208,18 +208,19 @@ colr->num_base_glyphs = FT_NEXT_USHORT( p ); base_glyph_offset = FT_NEXT_ULONG( p ); - if ( base_glyph_offset >= table_size ) + if ( table_size <= base_glyph_offset ) goto InvalidTable; - if ( colr->num_base_glyphs * BASE_GLYPH_SIZE > - table_size - base_glyph_offset ) + if ( ( table_size - base_glyph_offset ) / BASE_GLYPH_SIZE + < colr->num_base_glyphs ) goto InvalidTable; layer_offset = FT_NEXT_ULONG( p ); colr->num_layers = FT_NEXT_USHORT( p ); - if ( layer_offset >= table_size ) + if ( table_size <= layer_offset ) goto InvalidTable; - if ( colr->num_layers * LAYER_SIZE > table_size - layer_offset ) + if ( ( table_size - layer_offset ) / LAYER_SIZE + < colr->num_layers ) goto InvalidTable; if ( colr->version == 1 ) @@ -229,14 +230,14 @@ base_glyphs_offset_v1 = FT_NEXT_ULONG( p ); - if ( base_glyphs_offset_v1 >= table_size - 4 ) + if ( table_size - 4 <= base_glyphs_offset_v1 ) goto InvalidTable; p1 = (FT_Byte*)( table + base_glyphs_offset_v1 ); num_base_glyphs_v1 = FT_PEEK_ULONG( p1 ); - if ( num_base_glyphs_v1 * BASE_GLYPH_PAINT_RECORD_SIZE > - table_size - base_glyphs_offset_v1 ) + if ( ( table_size - base_glyphs_offset_v1 ) / BASE_GLYPH_PAINT_RECORD_SIZE + < num_base_glyphs_v1 ) goto InvalidTable; colr->num_base_glyphs_v1 = num_base_glyphs_v1; @@ -244,19 +245,19 @@ layer_offset_v1 = FT_NEXT_ULONG( p ); - if ( layer_offset_v1 >= table_size ) + if ( table_size <= layer_offset_v1 ) goto InvalidTable; if ( layer_offset_v1 ) { - if ( layer_offset_v1 >= table_size - 4 ) + if ( table_size - 4 <= layer_offset_v1 ) goto InvalidTable; p1 = (FT_Byte*)( table + layer_offset_v1 ); num_layers_v1 = FT_PEEK_ULONG( p1 ); - if ( num_layers_v1 * LAYER_V1_LIST_PAINT_OFFSET_SIZE > - table_size - layer_offset_v1 ) + if ( ( table_size - layer_offset_v1 ) / LAYER_V1_LIST_PAINT_OFFSET_SIZE + < num_layers_v1 ) goto InvalidTable; colr->num_layers_v1 = num_layers_v1; @@ -279,7 +280,7 @@ clip_list_offset = FT_NEXT_ULONG( p ); - if ( clip_list_offset >= table_size ) + if ( table_size <= clip_list_offset ) goto InvalidTable; if ( clip_list_offset ) @@ -311,7 +312,7 @@ goto InvalidTable; var_store_offset = FT_NEXT_ULONG( p ); - if ( var_store_offset >= table_size ) + if ( table_size <= var_store_offset ) goto InvalidTable; if ( var_store_offset ) @@ -661,6 +662,7 @@ FT_UInt32 first_layer_index; + ENSURE_READ_BYTES( 5 ); num_layers = FT_NEXT_BYTE( p ); if ( num_layers > colr->num_layers_v1 ) return 0; @@ -1278,7 +1280,8 @@ while ( min < max ) { - FT_UInt mid = min + ( max - min ) / 2; + FT_UInt mid = min + ( max - min ) / 2; + FT_UShort gid; /* * `base_glyph_begin` is the beginning of `BaseGlyphV1List`; @@ -1287,8 +1290,7 @@ */ FT_Byte *p = base_glyph_begin + 4 + mid * BASE_GLYPH_PAINT_RECORD_SIZE; - FT_UShort gid = FT_NEXT_USHORT( p ); - + gid = FT_NEXT_USHORT( p ); if ( gid < glyph_id ) min = mid + 1; diff --git a/vendor/freetype/src/sfnt/ttcolr.h b/vendor/freetype/src/sfnt/ttcolr.h index 20c85f0359..30031464c7 100644 --- a/vendor/freetype/src/sfnt/ttcolr.h +++ b/vendor/freetype/src/sfnt/ttcolr.h @@ -4,7 +4,7 @@ * * TrueType and OpenType colored glyph layer support (specification). * - * Copyright (C) 2018-2023 by + * Copyright (C) 2018-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * Originally written by Shao Yu Zhang . diff --git a/vendor/freetype/src/sfnt/ttcpal.c b/vendor/freetype/src/sfnt/ttcpal.c index 46ae08596f..997eb869ff 100644 --- a/vendor/freetype/src/sfnt/ttcpal.c +++ b/vendor/freetype/src/sfnt/ttcpal.c @@ -4,7 +4,7 @@ * * TrueType and OpenType color palette support (body). * - * Copyright (C) 2018-2023 by + * Copyright (C) 2018-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * Originally written by Shao Yu Zhang . diff --git a/vendor/freetype/src/sfnt/ttcpal.h b/vendor/freetype/src/sfnt/ttcpal.h index 8e9913f0cc..bb301ae88b 100644 --- a/vendor/freetype/src/sfnt/ttcpal.h +++ b/vendor/freetype/src/sfnt/ttcpal.h @@ -4,7 +4,7 @@ * * TrueType and OpenType color palette support (specification). * - * Copyright (C) 2018-2023 by + * Copyright (C) 2018-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * Originally written by Shao Yu Zhang . diff --git a/vendor/freetype/src/sfnt/ttgpos.c b/vendor/freetype/src/sfnt/ttgpos.c new file mode 100644 index 0000000000..c5dd043d66 --- /dev/null +++ b/vendor/freetype/src/sfnt/ttgpos.c @@ -0,0 +1,606 @@ +/**************************************************************************** + * + * ttgpos.c + * + * Load the TrueType GPOS table. The only GPOS layout feature this + * currently supports is kerning, from x advances in the pair adjustment + * layout feature. + * + * Parts of the implementation were adapted from: + * https://github.com/nothings/stb/blob/master/stb_truetype.h + * + * GPOS spec reference available at: + * https://learn.microsoft.com/en-us/typography/opentype/spec/gpos + * + * Copyright (C) 2024 by + * David Saltzman + * + * This file is part of the FreeType project, and may only be used, + * modified, and distributed under the terms of the FreeType project + * license, LICENSE.TXT. By continuing to use, modify, or distribute + * this file you indicate that you have read the license and + * understand and accept it fully. + */ + +#include +#include +#include +#include "freetype/fttypes.h" +#include "freetype/internal/ftobjs.h" +#include "ttgpos.h" + + +#ifdef TT_CONFIG_OPTION_GPOS_KERNING + + /************************************************************************** + * + * The macro FT_COMPONENT is used in trace mode. It is an implicit + * parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log + * messages during execution. + */ +#undef FT_COMPONENT +#define FT_COMPONENT ttgpos + + + typedef enum coverage_table_format_type_ + { + COVERAGE_TABLE_FORMAT_LIST = 1, + COVERAGE_TABLE_FORMAT_RANGE = 2 + + } coverage_table_format_type; + + typedef enum class_def_table_format_type_ + { + CLASS_DEF_TABLE_FORMAT_ARRAY = 1, + CLASS_DEF_TABLE_FORMAT_RANGE_GROUPS = 2 + + } class_def_table_format_type; + + typedef enum gpos_lookup_type_ + { + GPOS_LOOKUP_TYPE_SINGLE_ADJUSTMENT = 1, + GPOS_LOOKUP_TYPE_PAIR_ADJUSTMENT = 2, + GPOS_LOOKUP_TYPE_CURSIVE_ATTACHMENT = 3, + GPOS_LOOKUP_TYPE_MARK_TO_BASE_ATTACHMENT = 4, + GPOS_LOOKUP_TYPE_MARK_TO_LIGATURE_ATTACHMENT = 5, + GPOS_LOOKUP_TYPE_MARK_TO_MARK_ATTACHMENT = 6, + GPOS_LOOKUP_TYPE_CONTEXT_POSITIONING = 7, + GPOS_LOOKUP_TYPE_CHAINED_CONTEXT_POSITIONING = 8, + GPOS_LOOKUP_TYPE_EXTENSION_POSITIONING = 9 + + } gpos_lookup_type; + + typedef enum gpos_pair_adjustment_format_ + { + GPOS_PAIR_ADJUSTMENT_FORMAT_GLYPH_PAIR = 1, + GPOS_PAIR_ADJUSTMENT_FORMAT_CLASS_PAIR = 2 + + } gpos_pair_adjustment_format; + + typedef enum gpos_value_format_bitmask_ + { + GPOS_VALUE_FORMAT_NONE = 0x0000, + GPOS_VALUE_FORMAT_X_PLACEMENT = 0x0001, + GPOS_VALUE_FORMAT_Y_PLACEMENT = 0x0002, + GPOS_VALUE_FORMAT_X_ADVANCE = 0x0004, + GPOS_VALUE_FORMAT_Y_ADVANCE = 0x0008, + GPOS_VALUE_FORMAT_X_PLACEMENT_DEVICE = 0x0010, + GPOS_VALUE_FORMAT_Y_PLACEMENT_DEVICE = 0x0020, + GPOS_VALUE_FORMAT_X_ADVANCE_DEVICE = 0x0040, + GPOS_VALUE_FORMAT_Y_ADVANCE_DEVICE = 0x0080 + + } gpos_value_format_bitmask; + + + typedef struct TT_GPOS_Subtable_Iterator_Context_ + { + /* Iteration state. */ + FT_Byte* current_lookup_table; + gpos_lookup_type current_lookup_type; + FT_UShort subtable_count; + FT_Byte* subtable_offsets; + FT_UInt subtable_idx; + + /* Element for the current iteration. */ + FT_Byte* subtable; + gpos_lookup_type subtable_type; + + } TT_GPOS_Subtable_Iterator_Context; + + + /* Initialize a subtable iterator for a given lookup list index. */ + static void + tt_gpos_subtable_iterator_init( + TT_GPOS_Subtable_Iterator_Context* context, + FT_Byte* gpos_table, + FT_ULong lookup_list_idx ) + { + FT_Byte* lookup_list = gpos_table + FT_PEEK_USHORT( gpos_table + 8 ); + FT_UInt16 lookup_count = FT_PEEK_USHORT( lookup_list ); + + + if ( lookup_list_idx < lookup_count ) + { + context->current_lookup_table = + lookup_list + FT_PEEK_USHORT( lookup_list + 2 + 2 * lookup_list_idx ); + context->current_lookup_type = + (gpos_lookup_type)FT_PEEK_USHORT( context->current_lookup_table ); + context->subtable_count = + FT_PEEK_USHORT( context->current_lookup_table + 4 ); + context->subtable_offsets = context->current_lookup_table + 6; + } + else + { + context->current_lookup_table = NULL; + context->current_lookup_type = 0; + context->subtable_count = 0; + context->subtable_offsets = NULL; + } + + context->subtable_idx = 0; + context->subtable = NULL; + context->subtable_type = 0; + } + + + /* Get the next subtable. Return whether there was a next one. */ + static FT_Bool + tt_gpos_subtable_iterator_next( + TT_GPOS_Subtable_Iterator_Context* context ) + { + if ( context->subtable_idx < context->subtable_count ) + { + FT_UShort subtable_offset = + FT_PEEK_USHORT( context->subtable_offsets + + 2 * context->subtable_idx ); + + + context->subtable = context->current_lookup_table + subtable_offset; + + if ( context->current_lookup_type == + GPOS_LOOKUP_TYPE_EXTENSION_POSITIONING ) + { + /* Update type and subtable based on extension positioning header. */ + context->subtable_type = + (gpos_lookup_type)FT_PEEK_USHORT( context->subtable + 2 ); + context->subtable += FT_PEEK_ULONG( context->subtable + 4 ); + } + else + context->subtable_type = context->current_lookup_type; + + context->subtable_idx++; + return TRUE; + } + + return FALSE; + } + + + static FT_Int + tt_gpos_get_coverage_index( FT_Byte *coverage_table, + FT_UInt glyph ) + { + coverage_table_format_type coverage_format = + (coverage_table_format_type)FT_PEEK_USHORT( coverage_table ); + + + switch ( coverage_format ) + { + case COVERAGE_TABLE_FORMAT_LIST: + { + FT_UShort glyph_count = FT_PEEK_USHORT( coverage_table + 2 ); + + FT_Int l = 0; + FT_Int r = glyph_count - 1; + FT_Int m; + + FT_Int straw; + FT_Int needle = glyph; + + + /* Binary search. */ + while ( l <= r ) + { + FT_Byte *glyph_array = coverage_table + 4; + FT_UShort glyph_id; + + + m = ( l + r ) >> 1; + glyph_id = FT_PEEK_USHORT( glyph_array + 2 * m ); + straw = glyph_id; + + if ( needle < straw ) + r = m - 1; + else if ( needle > straw ) + l = m + 1; + else + return m; + } + break; + } + + case COVERAGE_TABLE_FORMAT_RANGE: + { + FT_UShort range_count = FT_PEEK_USHORT( coverage_table + 2 ); + FT_Byte *range_array = coverage_table + 4; + + FT_Int l = 0; + FT_Int r = range_count - 1; + FT_Int m; + + FT_Int straw_start; + FT_Int straw_end; + FT_Int needle = glyph; + + + /* Binary search. */ + while ( l <= r ) + { + FT_Byte *range_record; + + + m = ( l + r ) >> 1; + range_record = range_array + 6 * m; + straw_start = FT_PEEK_USHORT( range_record ); + straw_end = FT_PEEK_USHORT( range_record + 2 ); + + if ( needle < straw_start ) + r = m - 1; + else if ( needle > straw_end ) + l = m + 1; + else + { + FT_UShort start_coverage_index = + FT_PEEK_USHORT( range_record + 4 ); + + + return start_coverage_index + glyph - straw_start; + } + } + break; + } + + default: + return -1; /* unsupported */ + } + + return -1; + } + + + static FT_Int + tt_gpos_get_glyph_class( FT_Byte *class_def_table, + FT_UInt glyph ) + { + class_def_table_format_type class_def_format = + (class_def_table_format_type)FT_PEEK_USHORT( class_def_table ); + + + switch ( class_def_format ) + { + case CLASS_DEF_TABLE_FORMAT_ARRAY: + { + FT_UInt start_glyph_id = FT_PEEK_USHORT( class_def_table + 2 ); + FT_UInt glyph_count = FT_PEEK_USHORT( class_def_table + 4 ); + FT_Byte *class_value_array = class_def_table + 6; + + + if ( glyph >= start_glyph_id && + glyph < start_glyph_id + glyph_count ) + return (FT_Int)FT_PEEK_USHORT( class_value_array + + 2 * ( glyph - start_glyph_id ) ); + break; + } + + case CLASS_DEF_TABLE_FORMAT_RANGE_GROUPS: + { + FT_UShort class_range_count = FT_PEEK_USHORT( class_def_table + 2 ); + FT_Byte *class_range_records = class_def_table + 4; + + FT_Int l = 0; + FT_Int r = class_range_count - 1; + FT_Int m; + + FT_Int straw_start; + FT_Int straw_end; + FT_Int needle = glyph; + + + while ( l <= r ) + { + FT_Byte *class_range_record; + + + m = ( l + r ) >> 1; + class_range_record = class_range_records + 6 * m; + straw_start = FT_PEEK_USHORT( class_range_record ); + straw_end = FT_PEEK_USHORT( class_range_record + 2 ); + + if ( needle < straw_start ) + r = m - 1; + else if ( needle > straw_end ) + l = m + 1; + else + return (FT_Int)FT_PEEK_USHORT( class_range_record + 4 ); + } + break; + } + + default: + return -1; /* Unsupported definition type, return an error. */ + } + + /* "All glyphs not assigned to a class fall into class 0." */ + /* (OpenType spec) */ + return 0; + } + + + FT_LOCAL_DEF( FT_Error ) + tt_face_load_gpos( TT_Face face, + FT_Stream stream ) + { + FT_Error error; + FT_ULong table_size; + + + /* The GPOS table is optional; exit silently if it is missing. */ + error = face->goto_table( face, TTAG_GPOS, stream, &table_size ); + if ( error ) + goto Exit; + + if ( table_size < 4 ) /* the case of a malformed table */ + { + FT_ERROR(( "tt_face_load_gpos:" + " GPOS table is too small - ignored\n" )); + error = FT_THROW( Table_Missing ); + goto Exit; + } + + if ( FT_FRAME_EXTRACT( table_size, face->gpos_table ) ) + { + FT_ERROR(( "tt_face_load_gpos:" + " could not extract GPOS table\n" )); + goto Exit; + } + + face->gpos_kerning_available = FALSE; + + if ( face->gpos_table ) + { + FT_Byte* feature_list = face->gpos_table + + FT_PEEK_USHORT( face->gpos_table + 6 ); + FT_UInt16 feature_count = FT_PEEK_USHORT( feature_list ); + FT_Byte* feature_records = feature_list + 2; + + FT_UInt idx; + + + for ( idx = 0; idx < feature_count; idx++, feature_records += 6 ) + { + FT_ULong feature_tag = FT_PEEK_ULONG( feature_records ); + + + if ( feature_tag == TTAG_kern ) + { + face->gpos_kerning_available = TRUE; + break; + } + } + } + + Exit: + return error; + } + + + FT_LOCAL_DEF( void ) + tt_face_done_gpos( TT_Face face ) + { + FT_Stream stream = face->root.stream; + + + FT_FRAME_RELEASE( face->gpos_table ); + } + + + FT_LOCAL_DEF( FT_Int ) + tt_face_get_gpos_kerning( TT_Face face, + FT_UInt left_glyph, + FT_UInt right_glyph ) + { + FT_Byte* feature_list; + FT_UInt16 feature_count; + FT_Byte* feature_records; + FT_UInt feature_idx; + + + if ( !face->gpos_kerning_available ) + return 0; + + feature_list = face->gpos_table + + FT_PEEK_USHORT( face->gpos_table + 6 ); + feature_count = FT_PEEK_USHORT( feature_list ); + feature_records = feature_list + 2; + + for ( feature_idx = 0; + feature_idx < feature_count; + feature_idx++, feature_records += 6 ) + { + FT_ULong feature_tag = FT_PEEK_ULONG( feature_records ); + FT_Byte* feature_table; + FT_UInt16 lookup_idx_count; + FT_UInt16 lookup_idx; + + + if ( feature_tag != TTAG_kern ) + continue; + + feature_table = feature_list + FT_PEEK_USHORT( feature_records + 4 ); + lookup_idx_count = FT_PEEK_USHORT( feature_table + 2 ); + + for ( lookup_idx = 0; lookup_idx < lookup_idx_count; lookup_idx++ ) + { + FT_UInt16 lookup_list_idx = + FT_PEEK_USHORT( feature_table + 4 + 2 * lookup_idx ); + TT_GPOS_Subtable_Iterator_Context subtable_iter; + + + tt_gpos_subtable_iterator_init( &subtable_iter, + face->gpos_table, + lookup_list_idx ); + + while ( tt_gpos_subtable_iterator_next( &subtable_iter ) ) + { + FT_Byte* subtable; + + gpos_value_format_bitmask value_format_1; + gpos_value_format_bitmask value_format_2; + gpos_pair_adjustment_format format; + + FT_UShort coverage_offset; + FT_Int coverage_index; + + + if ( subtable_iter.subtable_type != + GPOS_LOOKUP_TYPE_PAIR_ADJUSTMENT ) + continue; + + subtable = subtable_iter.subtable; + + value_format_1 = + (gpos_value_format_bitmask)FT_PEEK_USHORT( subtable + 4 ); + value_format_2 = + (gpos_value_format_bitmask)FT_PEEK_USHORT( subtable + 6 ); + + if ( !( value_format_1 == GPOS_VALUE_FORMAT_X_ADVANCE && + value_format_2 == GPOS_VALUE_FORMAT_NONE ) ) + continue; + + format = (gpos_pair_adjustment_format)FT_PEEK_USHORT( subtable ); + + coverage_offset = FT_PEEK_USHORT( subtable + 2 ); + coverage_index = + tt_gpos_get_coverage_index( subtable + coverage_offset, + left_glyph ); + + if ( coverage_index == -1 ) + continue; + + switch ( format ) + { + case GPOS_PAIR_ADJUSTMENT_FORMAT_GLYPH_PAIR: + { + FT_Int l, r, m; + FT_Int straw, needle; + + FT_Int value_record_pair_size_in_bytes = 2; + + FT_UShort pair_set_count = FT_PEEK_USHORT( subtable + 8 ); + FT_UShort pair_pos_offset; + + FT_Byte* pair_value_table; + FT_UShort pair_value_count; + FT_Byte* pair_value_array; + + + if ( coverage_index >= pair_set_count ) + return 0; + + pair_pos_offset = + FT_PEEK_USHORT( subtable + 10 + 2 * coverage_index ); + + pair_value_table = subtable + pair_pos_offset; + pair_value_count = FT_PEEK_USHORT( pair_value_table ); + pair_value_array = pair_value_table + 2; + + needle = right_glyph; + r = pair_value_count - 1; + l = 0; + + /* Binary search. */ + while ( l <= r ) + { + FT_UShort second_glyph; + FT_Byte* pair_value; + + + m = ( l + r ) >> 1; + pair_value = pair_value_array + + ( 2 + value_record_pair_size_in_bytes ) * m; + second_glyph = FT_PEEK_USHORT( pair_value ); + straw = second_glyph; + + if ( needle < straw ) + r = m - 1; + else if ( needle > straw ) + l = m + 1; + else + { + FT_Short x_advance = FT_PEEK_SHORT( pair_value + 2 ); + + + return x_advance; + } + } + break; + } + + case GPOS_PAIR_ADJUSTMENT_FORMAT_CLASS_PAIR: + { + FT_UShort class_def1_offset = FT_PEEK_USHORT( subtable + 8 ); + FT_UShort class_def2_offset = FT_PEEK_USHORT( subtable + 10 ); + + FT_Int left_glyph_class = + tt_gpos_get_glyph_class( subtable + class_def1_offset, + left_glyph ); + FT_Int right_glyph_class = + tt_gpos_get_glyph_class( subtable + class_def2_offset, + right_glyph ); + + FT_UShort class1_count = FT_PEEK_USHORT( subtable + 12 ); + FT_UShort class2_count = FT_PEEK_USHORT( subtable + 14 ); + + FT_Byte *class1_records, *class2_records; + FT_Short x_advance; + + + if ( left_glyph_class < 0 || + left_glyph_class >= class1_count ) + return 0; /* malformed */ + if ( right_glyph_class < 0 || + right_glyph_class >= class2_count ) + return 0; /* malformed */ + + if ( right_glyph_class == 0 ) + continue; /* right glyph not found in this table */ + + class1_records = subtable + 16; + class2_records = + class1_records + 2 * ( left_glyph_class * class2_count ); + + x_advance = + FT_PEEK_SHORT( class2_records + 2 * right_glyph_class ); + + return x_advance; + } + + default: + return 0; + } + } + } + } + + return 0; + } + +#else /* !TT_CONFIG_OPTION_GPOS_KERNING */ + + /* ANSI C doesn't like empty source files */ + typedef int tt_gpos_dummy_; + +#endif /* !TT_CONFIG_OPTION_GPOS_KERNING */ + + +/* END */ diff --git a/vendor/freetype/src/sfnt/ttgpos.h b/vendor/freetype/src/sfnt/ttgpos.h new file mode 100644 index 0000000000..570e9e3d75 --- /dev/null +++ b/vendor/freetype/src/sfnt/ttgpos.h @@ -0,0 +1,53 @@ +/**************************************************************************** + * + * ttgpos.c + * + * Load the TrueType GPOS table. The only GPOS layout feature this + * currently supports is kerning, from x advances in the pair adjustment + * layout feature. + * + * Copyright (C) 2024 by + * David Saltzman + * + * This file is part of the FreeType project, and may only be used, + * modified, and distributed under the terms of the FreeType project + * license, LICENSE.TXT. By continuing to use, modify, or distribute + * this file you indicate that you have read the license and + * understand and accept it fully. + */ + + +#ifndef TTGPOS_H_ +#define TTGPOS_H_ + + +#include +#include + + +FT_BEGIN_HEADER + + +#ifdef TT_CONFIG_OPTION_GPOS_KERNING + + FT_LOCAL( FT_Error ) + tt_face_load_gpos( TT_Face face, + FT_Stream stream ); + + FT_LOCAL( void ) + tt_face_done_gpos( TT_Face face ); + + FT_LOCAL( FT_Int ) + tt_face_get_gpos_kerning( TT_Face face, + FT_UInt left_glyph, + FT_UInt right_glyph ); + +#endif /* TT_CONFIG_OPTION_GPOS_KERNING */ + + +FT_END_HEADER + +#endif /* TTGPOS_H_ */ + + +/* END */ diff --git a/vendor/freetype/src/sfnt/ttkern.c b/vendor/freetype/src/sfnt/ttkern.c index a47d08bd6d..f0411366af 100644 --- a/vendor/freetype/src/sfnt/ttkern.c +++ b/vendor/freetype/src/sfnt/ttkern.c @@ -5,7 +5,7 @@ * Load the basic TrueType kerning table. This doesn't handle * kerning data within the GPOS table at the moment. * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/sfnt/ttkern.h b/vendor/freetype/src/sfnt/ttkern.h index 960c7da494..a54e51df12 100644 --- a/vendor/freetype/src/sfnt/ttkern.h +++ b/vendor/freetype/src/sfnt/ttkern.h @@ -5,7 +5,7 @@ * Load the basic TrueType kerning table. This doesn't handle * kerning data within the GPOS table at the moment. * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/sfnt/ttload.c b/vendor/freetype/src/sfnt/ttload.c index 7b44e9cd2e..fe4d51559c 100644 --- a/vendor/freetype/src/sfnt/ttload.c +++ b/vendor/freetype/src/sfnt/ttload.c @@ -5,7 +5,7 @@ * Load the basic TrueType tables, i.e., tables that can be either in * TTF or OTF fonts (body). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/sfnt/ttload.h b/vendor/freetype/src/sfnt/ttload.h index 1499dd5735..2b1d62d9bd 100644 --- a/vendor/freetype/src/sfnt/ttload.h +++ b/vendor/freetype/src/sfnt/ttload.h @@ -5,7 +5,7 @@ * Load the basic TrueType tables, i.e., tables that can be either in * TTF or OTF fonts (specification). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/sfnt/ttmtx.c b/vendor/freetype/src/sfnt/ttmtx.c index 38ee9ae728..2788411856 100644 --- a/vendor/freetype/src/sfnt/ttmtx.c +++ b/vendor/freetype/src/sfnt/ttmtx.c @@ -4,7 +4,7 @@ * * Load the metrics tables common to TTF and OTF fonts (body). * - * Copyright (C) 2006-2023 by + * Copyright (C) 2006-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/sfnt/ttmtx.h b/vendor/freetype/src/sfnt/ttmtx.h index 56d2b62766..34b3c0e18f 100644 --- a/vendor/freetype/src/sfnt/ttmtx.h +++ b/vendor/freetype/src/sfnt/ttmtx.h @@ -4,7 +4,7 @@ * * Load the metrics tables common to TTF and OTF fonts (specification). * - * Copyright (C) 2006-2023 by + * Copyright (C) 2006-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/sfnt/ttpost.c b/vendor/freetype/src/sfnt/ttpost.c index 1dfad4298b..a90237ad03 100644 --- a/vendor/freetype/src/sfnt/ttpost.c +++ b/vendor/freetype/src/sfnt/ttpost.c @@ -5,7 +5,7 @@ * PostScript name table processing for TrueType and OpenType fonts * (body). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -204,8 +204,8 @@ /* now load the name strings */ if ( num_names ) { - FT_ULong p; - FT_Byte* strings; + FT_Byte* p; + FT_Byte* p_end; post_len -= (FT_ULong)num_glyphs * 2; @@ -214,27 +214,27 @@ post_len + 1 ) ) goto Fail; - strings = (FT_Byte*)( name_strings + num_names ); - if ( FT_STREAM_READ( strings, post_len ) ) + p = (FT_Byte*)( name_strings + num_names ); + if ( FT_STREAM_READ( p, post_len ) ) goto Fail; + p_end = p + post_len; + /* convert from Pascal- to C-strings and set pointers */ - for ( p = 0, n = 0; p < post_len && n < num_names; n++ ) + for ( n = 0; p < p_end && n < num_names; n++ ) { - FT_UInt len = strings[p]; + FT_UInt len = *p; - if ( len > 63U ) - { - error = FT_THROW( Invalid_File_Format ); - goto Fail; - } + /* all names in Adobe Glyph List are shorter than 40 characters */ + if ( len >= 40U ) + FT_TRACE4(( "load_format_20: unusual %u-char name found\n", len )); - strings[p] = 0; - name_strings[n] = strings + p + 1; - p += len + 1; + *p++ = 0; + name_strings[n] = p; + p += len; } - strings[post_len] = 0; + *p_end = 0; /* deal with missing or insufficient string data */ if ( n < num_names ) @@ -243,7 +243,7 @@ num_names - n )); for ( ; n < num_names; n++ ) - name_strings[n] = strings + post_len; + name_strings[n] = p_end; } } @@ -436,13 +436,8 @@ format = face->postscript.FormatType; - if ( format == 0x00010000L ) - { - if ( idx < 258 ) /* paranoid checking */ - *PSname = MAC_NAME( idx ); - } - else if ( format == 0x00020000L || - format == 0x00025000L ) + if ( format == 0x00020000L || + format == 0x00025000L ) { TT_Post_Names names = &face->postscript_names; @@ -466,6 +461,11 @@ } } + /* version 1.0 is only valid with 258 glyphs */ + else if ( format == 0x00010000L && + face->max_profile.numGlyphs == 258 ) + *PSname = MAC_NAME( idx ); + /* nothing to do for format == 0x00030000L */ End: diff --git a/vendor/freetype/src/sfnt/ttpost.h b/vendor/freetype/src/sfnt/ttpost.h index 528f1c5f2f..150db6c398 100644 --- a/vendor/freetype/src/sfnt/ttpost.h +++ b/vendor/freetype/src/sfnt/ttpost.h @@ -5,7 +5,7 @@ * PostScript name table processing for TrueType and OpenType fonts * (specification). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/sfnt/ttsbit.c b/vendor/freetype/src/sfnt/ttsbit.c index 03f90a628d..cb3a8abf18 100644 --- a/vendor/freetype/src/sfnt/ttsbit.c +++ b/vendor/freetype/src/sfnt/ttsbit.c @@ -4,7 +4,7 @@ * * TrueType and OpenType embedded bitmap support (body). * - * Copyright (C) 2005-2023 by + * Copyright (C) 2005-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * Copyright 2013 by Google, Inc. diff --git a/vendor/freetype/src/sfnt/ttsbit.h b/vendor/freetype/src/sfnt/ttsbit.h index 07e2db461a..96f80a5842 100644 --- a/vendor/freetype/src/sfnt/ttsbit.h +++ b/vendor/freetype/src/sfnt/ttsbit.h @@ -4,7 +4,7 @@ * * TrueType and OpenType embedded bitmap support (specification). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/sfnt/ttsvg.c b/vendor/freetype/src/sfnt/ttsvg.c index 4461d483b0..298afd8b55 100644 --- a/vendor/freetype/src/sfnt/ttsvg.c +++ b/vendor/freetype/src/sfnt/ttsvg.c @@ -4,7 +4,7 @@ * * OpenType SVG Color (specification). * - * Copyright (C) 2022-2023 by + * Copyright (C) 2022-2024 by * David Turner, Robert Wilhelm, Werner Lemberg, and Moazin Khatti. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/sfnt/ttsvg.h b/vendor/freetype/src/sfnt/ttsvg.h index 3f32321ded..20f9e47c99 100644 --- a/vendor/freetype/src/sfnt/ttsvg.h +++ b/vendor/freetype/src/sfnt/ttsvg.h @@ -4,7 +4,7 @@ * * OpenType SVG Color (specification). * - * Copyright (C) 2022-2023 by + * Copyright (C) 2022-2024 by * David Turner, Robert Wilhelm, Werner Lemberg, and Moazin Khatti. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/sfnt/woff2tags.c b/vendor/freetype/src/sfnt/woff2tags.c index eeedd9906b..532ccfa173 100644 --- a/vendor/freetype/src/sfnt/woff2tags.c +++ b/vendor/freetype/src/sfnt/woff2tags.c @@ -4,7 +4,7 @@ * * WOFF2 Font table tags (base). * - * Copyright (C) 2019-2023 by + * Copyright (C) 2019-2024 by * Nikhil Ramakrishnan, David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/sfnt/woff2tags.h b/vendor/freetype/src/sfnt/woff2tags.h index 1201848e5e..d03b4b41bc 100644 --- a/vendor/freetype/src/sfnt/woff2tags.h +++ b/vendor/freetype/src/sfnt/woff2tags.h @@ -4,7 +4,7 @@ * * WOFF2 Font table tags (specification). * - * Copyright (C) 2019-2023 by + * Copyright (C) 2019-2024 by * Nikhil Ramakrishnan, David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/smooth/ftgrays.c b/vendor/freetype/src/smooth/ftgrays.c index 0918272f87..b7c0632a6f 100644 --- a/vendor/freetype/src/smooth/ftgrays.c +++ b/vendor/freetype/src/smooth/ftgrays.c @@ -4,7 +4,7 @@ * * A new `perfect' anti-aliasing renderer (body). * - * Copyright (C) 2000-2023 by + * Copyright (C) 2000-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -489,7 +489,7 @@ typedef ptrdiff_t FT_PtrDist; typedef struct gray_TWorker_ { - ft_jmp_buf jump_buffer; + FT_BBox cbox; TCoord min_ex, max_ex; /* min and max integer pixel coordinates */ TCoord min_ey, max_ey; @@ -510,6 +510,8 @@ typedef ptrdiff_t FT_PtrDist; FT_Raster_Span_Func render_span; void* render_span_data; + ft_jmp_buf jump_buffer; + } gray_TWorker, *gray_PWorker; #if defined( _MSC_VER ) @@ -997,49 +999,12 @@ typedef ptrdiff_t FT_PtrDist; #endif /* - * Benchmarking shows that using DDA to flatten the quadratic Bézier arcs - * is slightly faster in the following cases: - * - * - When the host CPU is 64-bit. - * - When SSE2 SIMD registers and instructions are available (even on - * x86). - * - * For other cases, using binary splits is actually slightly faster. - */ -#if ( defined( __SSE2__ ) || \ - defined( __x86_64__ ) || \ - defined( _M_AMD64 ) || \ - ( defined( _M_IX86_FP ) && _M_IX86_FP >= 2 ) ) && \ - !defined( __VMS ) -# define FT_SSE2 1 -#else -# define FT_SSE2 0 -#endif - -#if FT_SSE2 || \ - defined( __aarch64__ ) || \ - defined( _M_ARM64 ) -# define BEZIER_USE_DDA 1 -#else -# define BEZIER_USE_DDA 0 -#endif - - /* - * For now, the code that depends on `BEZIER_USE_DDA` requires `FT_Int64` - * to be defined. If `FT_INT64` is not defined, meaning there is no - * 64-bit type available, disable it to avoid compilation errors. See for - * example https://gitlab.freedesktop.org/freetype/freetype/-/issues/1071. + * For now, the code that uses DDA to render conic curves requires + * `FT_Int64` to be defined. See for example + * https://gitlab.freedesktop.org/freetype/freetype/-/issues/1071. */ -#if !defined( FT_INT64 ) -# undef BEZIER_USE_DDA -# define BEZIER_USE_DDA 0 -#endif - -#if BEZIER_USE_DDA -#if FT_SSE2 -# include -#endif +#ifdef FT_INT64 #define LEFT_SHIFT( a, b ) (FT_Int64)( (FT_UInt64)(a) << (b) ) @@ -1095,16 +1060,17 @@ typedef ptrdiff_t FT_PtrDist; return; } - /* We can calculate the number of necessary bisections because */ + /* We can calculate the number of necessary segments because */ /* each bisection predictably reduces deviation exactly 4-fold. */ /* Even 32-bit deviation would vanish after 16 bisections. */ - shift = 0; + shift = 16; do { - dx >>= 2; - shift += 1; + dx >>= 2; + shift--; } while ( dx > ONE_PIXEL / 4 ); + count = 0x10000U >> shift; /* * The (P0,P1,P2) arc equation, for t in [0,1] range: @@ -1150,75 +1116,19 @@ typedef ptrdiff_t FT_PtrDist; * = (B << (33 - N)) + (A << (32 - 2*N)) */ -#if FT_SSE2 - /* Experience shows that for small shift values, */ - /* SSE2 is actually slower. */ - if ( shift > 2 ) - { - union - { - struct { FT_Int64 ax, ay, bx, by; } i; - struct { __m128i a, b; } vec; - - } u; - - union - { - struct { FT_Int32 px_lo, px_hi, py_lo, py_hi; } i; - __m128i vec; - - } v; - - __m128i a, b; - __m128i r, q, q2; - __m128i p; - - - u.i.ax = ax; - u.i.ay = ay; - u.i.bx = bx; - u.i.by = by; - - a = _mm_load_si128( &u.vec.a ); - b = _mm_load_si128( &u.vec.b ); - - r = _mm_slli_epi64( a, 33 - 2 * shift ); - q = _mm_slli_epi64( b, 33 - shift ); - q2 = _mm_slli_epi64( a, 32 - 2 * shift ); - - q = _mm_add_epi64( q2, q ); - - v.i.px_lo = 0; - v.i.px_hi = p0.x; - v.i.py_lo = 0; - v.i.py_hi = p0.y; - - p = _mm_load_si128( &v.vec ); - - for ( count = 1U << shift; count > 0; count-- ) - { - p = _mm_add_epi64( p, q ); - q = _mm_add_epi64( q, r ); - - _mm_store_si128( &v.vec, p ); - - gray_render_line( RAS_VAR_ v.i.px_hi, v.i.py_hi ); - } - - return; - } -#endif /* FT_SSE2 */ + rx = LEFT_SHIFT( ax, shift + shift ); + ry = LEFT_SHIFT( ay, shift + shift ); - rx = LEFT_SHIFT( ax, 33 - 2 * shift ); - ry = LEFT_SHIFT( ay, 33 - 2 * shift ); + qx = LEFT_SHIFT( bx, shift + 17 ) + rx; + qy = LEFT_SHIFT( by, shift + 17 ) + ry; - qx = LEFT_SHIFT( bx, 33 - shift ) + LEFT_SHIFT( ax, 32 - 2 * shift ); - qy = LEFT_SHIFT( by, 33 - shift ) + LEFT_SHIFT( ay, 32 - 2 * shift ); + rx *= 2; + ry *= 2; px = LEFT_SHIFT( p0.x, 32 ); py = LEFT_SHIFT( p0.y, 32 ); - for ( count = 1U << shift; count > 0; count-- ) + do { px += qx; py += qy; @@ -1227,10 +1137,10 @@ typedef ptrdiff_t FT_PtrDist; gray_render_line( RAS_VAR_ (FT_Pos)( px >> 32 ), (FT_Pos)( py >> 32 ) ); - } + } while ( --count ); } -#else /* !BEZIER_USE_DDA */ +#else /* !FT_INT64 */ /* * Note that multiple attempts to speed up the function below @@ -1324,7 +1234,7 @@ typedef ptrdiff_t FT_PtrDist; } while ( --draw ); } -#endif /* !BEZIER_USE_DDA */ +#endif /* !FT_INT64 */ /* @@ -1486,139 +1396,6 @@ typedef ptrdiff_t FT_PtrDist; } - static void - gray_sweep( RAS_ARG ) - { - int fill = ( ras.outline.flags & FT_OUTLINE_EVEN_ODD_FILL ) ? 0x100 - : INT_MIN; - int coverage; - int y; - - - for ( y = ras.min_ey; y < ras.max_ey; y++ ) - { - PCell cell = ras.ycells[y - ras.min_ey]; - TCoord x = ras.min_ex; - TArea cover = 0; - - unsigned char* line = ras.target.origin - ras.target.pitch * y; - - - for ( ; cell != ras.cell_null; cell = cell->next ) - { - TArea area; - - - if ( cover != 0 && cell->x > x ) - { - FT_FILL_RULE( coverage, cover, fill ); - FT_GRAY_SET( line + x, coverage, cell->x - x ); - } - - cover += (TArea)cell->cover * ( ONE_PIXEL * 2 ); - area = cover - cell->area; - - if ( area != 0 && cell->x >= ras.min_ex ) - { - FT_FILL_RULE( coverage, area, fill ); - line[cell->x] = (unsigned char)coverage; - } - - x = cell->x + 1; - } - - if ( cover != 0 ) /* only if cropped */ - { - FT_FILL_RULE( coverage, cover, fill ); - FT_GRAY_SET( line + x, coverage, ras.max_ex - x ); - } - } - } - - - static void - gray_sweep_direct( RAS_ARG ) - { - int fill = ( ras.outline.flags & FT_OUTLINE_EVEN_ODD_FILL ) ? 0x100 - : INT_MIN; - int coverage; - int y; - - FT_Span span[FT_MAX_GRAY_SPANS]; - int n = 0; - - - for ( y = ras.min_ey; y < ras.max_ey; y++ ) - { - PCell cell = ras.ycells[y - ras.min_ey]; - TCoord x = ras.min_ex; - TArea cover = 0; - - - for ( ; cell != ras.cell_null; cell = cell->next ) - { - TArea area; - - - if ( cover != 0 && cell->x > x ) - { - FT_FILL_RULE( coverage, cover, fill ); - - span[n].coverage = (unsigned char)coverage; - span[n].x = (short)x; - span[n].len = (unsigned short)( cell->x - x ); - - if ( ++n == FT_MAX_GRAY_SPANS ) - { - /* flush the span buffer and reset the count */ - ras.render_span( y, n, span, ras.render_span_data ); - n = 0; - } - } - - cover += (TArea)cell->cover * ( ONE_PIXEL * 2 ); - area = cover - cell->area; - - if ( area != 0 && cell->x >= ras.min_ex ) - { - FT_FILL_RULE( coverage, area, fill ); - - span[n].coverage = (unsigned char)coverage; - span[n].x = (short)cell->x; - span[n].len = 1; - - if ( ++n == FT_MAX_GRAY_SPANS ) - { - /* flush the span buffer and reset the count */ - ras.render_span( y, n, span, ras.render_span_data ); - n = 0; - } - } - - x = cell->x + 1; - } - - if ( cover != 0 ) /* only if cropped */ - { - FT_FILL_RULE( coverage, cover, fill ); - - span[n].coverage = (unsigned char)coverage; - span[n].x = (short)x; - span[n].len = (unsigned short)( ras.max_ex - x ); - - ++n; - } - - if ( n ) - { - /* flush the span buffer and reset the count */ - ras.render_span( y, n, span, ras.render_span_data ); - n = 0; - } - } - } - - #ifdef STANDALONE_ /************************************************************************** @@ -1934,7 +1711,7 @@ typedef ptrdiff_t FT_PtrDist; if ( continued ) FT_Trace_Enable(); - FT_TRACE7(( "band [%d..%d]: %td cell%s remaining/\n", + FT_TRACE7(( "band [%d..%d]: %td cell%s remaining\n", ras.min_ey, ras.max_ey, ras.cell_null - ras.cell_free, @@ -1952,14 +1729,144 @@ typedef ptrdiff_t FT_PtrDist; } + static void + gray_sweep( RAS_ARG ) + { + int fill = ( ras.outline.flags & FT_OUTLINE_EVEN_ODD_FILL ) ? 0x100 + : INT_MIN; + int coverage; + int y; + + + for ( y = ras.min_ey; y < ras.max_ey; y++ ) + { + PCell cell = ras.ycells[y - ras.min_ey]; + TCoord x = ras.min_ex; + TArea cover = 0; + + unsigned char* line = ras.target.origin - ras.target.pitch * y; + + + for ( ; cell != ras.cell_null; cell = cell->next ) + { + TArea area; + + + if ( cover != 0 && cell->x > x ) + { + FT_FILL_RULE( coverage, cover, fill ); + FT_GRAY_SET( line + x, coverage, cell->x - x ); + } + + cover += (TArea)cell->cover * ( ONE_PIXEL * 2 ); + area = cover - cell->area; + + if ( area != 0 && cell->x >= ras.min_ex ) + { + FT_FILL_RULE( coverage, area, fill ); + line[cell->x] = (unsigned char)coverage; + } + + x = cell->x + 1; + } + + if ( cover != 0 ) /* only if cropped */ + { + FT_FILL_RULE( coverage, cover, fill ); + FT_GRAY_SET( line + x, coverage, ras.max_ex - x ); + } + } + } + + + static void + gray_sweep_direct( RAS_ARG ) + { + int fill = ( ras.outline.flags & FT_OUTLINE_EVEN_ODD_FILL ) ? 0x100 + : INT_MIN; + int coverage; + int y; + + FT_Span span[FT_MAX_GRAY_SPANS]; + int n = 0; + + + for ( y = ras.min_ey; y < ras.max_ey; y++ ) + { + PCell cell = ras.ycells[y - ras.min_ey]; + TCoord x = ras.min_ex; + TArea cover = 0; + + + for ( ; cell != ras.cell_null; cell = cell->next ) + { + TArea area; + + + if ( cover != 0 && cell->x > x ) + { + FT_FILL_RULE( coverage, cover, fill ); + + span[n].coverage = (unsigned char)coverage; + span[n].x = (short)x; + span[n].len = (unsigned short)( cell->x - x ); + + if ( ++n == FT_MAX_GRAY_SPANS ) + { + /* flush the span buffer and reset the count */ + ras.render_span( y, n, span, ras.render_span_data ); + n = 0; + } + } + + cover += (TArea)cell->cover * ( ONE_PIXEL * 2 ); + area = cover - cell->area; + + if ( area != 0 && cell->x >= ras.min_ex ) + { + FT_FILL_RULE( coverage, area, fill ); + + span[n].coverage = (unsigned char)coverage; + span[n].x = (short)cell->x; + span[n].len = 1; + + if ( ++n == FT_MAX_GRAY_SPANS ) + { + /* flush the span buffer and reset the count */ + ras.render_span( y, n, span, ras.render_span_data ); + n = 0; + } + } + + x = cell->x + 1; + } + + if ( cover != 0 ) /* only if cropped */ + { + FT_FILL_RULE( coverage, cover, fill ); + + span[n].coverage = (unsigned char)coverage; + span[n].x = (short)x; + span[n].len = (unsigned short)( ras.max_ex - x ); + + ++n; + } + + if ( n ) + { + /* flush the span buffer and reset the count */ + ras.render_span( y, n, span, ras.render_span_data ); + n = 0; + } + } + } + + static int gray_convert_glyph( RAS_ARG ) { - const TCoord yMin = ras.min_ey; - const TCoord yMax = ras.max_ey; - TCell buffer[FT_MAX_GRAY_POOL]; - size_t height = (size_t)( yMax - yMin ); + size_t height = (size_t)( ras.cbox.yMax - ras.cbox.yMin ); size_t n = FT_MAX_GRAY_POOL / 8; TCoord y; TCoord bands[32]; /* enough to accommodate bisections */ @@ -1985,35 +1892,36 @@ typedef ptrdiff_t FT_PtrDist; height = ( height + n - 1 ) / n; } - for ( y = yMin; y < yMax; ) + for ( y = ras.cbox.yMin; y < ras.cbox.yMax; ) { ras.min_ey = y; y += height; - ras.max_ey = FT_MIN( y, yMax ); + ras.max_ey = FT_MIN( y, ras.cbox.yMax ); + + ras.count_ey = ras.max_ey - ras.min_ey; band = bands; - band[1] = ras.min_ey; - band[0] = ras.max_ey; + band[1] = ras.cbox.xMin; + band[0] = ras.cbox.xMax; do { - TCoord width = band[0] - band[1]; - TCoord w; + TCoord i; int error; - for ( w = 0; w < width; ++w ) - ras.ycells[w] = ras.cell_null; + ras.min_ex = band[1]; + ras.max_ex = band[0]; + + /* memory management: zero out and skip ycells */ + for ( i = 0; i < ras.count_ey; ++i ) + ras.ycells[i] = ras.cell_null; - /* memory management: skip ycells */ - n = ( (size_t)width * sizeof ( PCell ) + sizeof ( TCell ) - 1 ) / - sizeof ( TCell ); + n = ( (size_t)ras.count_ey * sizeof ( PCell ) + sizeof ( TCell ) - 1 ) + / sizeof ( TCell ); ras.cell_free = buffer + n; ras.cell = ras.cell_null; - ras.min_ey = band[1]; - ras.max_ey = band[0]; - ras.count_ey = width; error = gray_convert_glyph_inner( RAS_VAR_ continued ); continued = 1; @@ -2031,10 +1939,10 @@ typedef ptrdiff_t FT_PtrDist; return error; /* render pool overflow; we will reduce the render band by half */ - width >>= 1; + i = ( band[0] - band[1] ) >> 1; /* this should never happen even with tiny rendering pool */ - if ( width == 0 ) + if ( i == 0 ) { FT_TRACE7(( "gray_convert_glyph: rotten glyph\n" )); return FT_THROW( Raster_Overflow ); @@ -2042,7 +1950,7 @@ typedef ptrdiff_t FT_PtrDist; band++; band[1] = band[0]; - band[0] += width; + band[0] += i; } while ( band >= bands ); } @@ -2073,7 +1981,7 @@ typedef ptrdiff_t FT_PtrDist; return FT_THROW( Invalid_Outline ); /* return immediately if the outline is empty */ - if ( outline->n_points == 0 || outline->n_contours <= 0 ) + if ( outline->n_points == 0 || outline->n_contours == 0 ) return Smooth_Err_Ok; if ( !outline->contours || !outline->points ) @@ -2093,10 +2001,7 @@ typedef ptrdiff_t FT_PtrDist; ras.render_span = (FT_Raster_Span_Func)params->gray_spans; ras.render_span_data = params->user; - ras.min_ex = params->clip_box.xMin; - ras.min_ey = params->clip_box.yMin; - ras.max_ex = params->clip_box.xMax; - ras.max_ey = params->clip_box.yMax; + ras.cbox = params->clip_box; } else { @@ -2122,14 +2027,14 @@ typedef ptrdiff_t FT_PtrDist; ras.render_span = (FT_Raster_Span_Func)NULL; ras.render_span_data = NULL; - ras.min_ex = 0; - ras.min_ey = 0; - ras.max_ex = (FT_Pos)target_map->width; - ras.max_ey = (FT_Pos)target_map->rows; + ras.cbox.xMin = 0; + ras.cbox.yMin = 0; + ras.cbox.xMax = (FT_Pos)target_map->width; + ras.cbox.yMax = (FT_Pos)target_map->rows; } /* exit if nothing to do */ - if ( ras.max_ex <= ras.min_ex || ras.max_ey <= ras.min_ey ) + if ( ras.cbox.xMin >= ras.cbox.xMax || ras.cbox.yMin >= ras.cbox.yMax ) return Smooth_Err_Ok; return gray_convert_glyph( RAS_VAR ); diff --git a/vendor/freetype/src/smooth/ftgrays.h b/vendor/freetype/src/smooth/ftgrays.h index a5001bf40d..940fbe8c79 100644 --- a/vendor/freetype/src/smooth/ftgrays.h +++ b/vendor/freetype/src/smooth/ftgrays.h @@ -4,7 +4,7 @@ * * FreeType smooth renderer declaration * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/smooth/ftsmerrs.h b/vendor/freetype/src/smooth/ftsmerrs.h index f4ac93dc41..6d41fb8e0f 100644 --- a/vendor/freetype/src/smooth/ftsmerrs.h +++ b/vendor/freetype/src/smooth/ftsmerrs.h @@ -4,7 +4,7 @@ * * smooth renderer error codes (specification only). * - * Copyright (C) 2001-2023 by + * Copyright (C) 2001-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/smooth/ftsmooth.c b/vendor/freetype/src/smooth/ftsmooth.c index 9b0e8886cb..f0acc1ea4a 100644 --- a/vendor/freetype/src/smooth/ftsmooth.c +++ b/vendor/freetype/src/smooth/ftsmooth.c @@ -4,7 +4,7 @@ * * Anti-aliasing renderer interface (body). * - * Copyright (C) 2000-2023 by + * Copyright (C) 2000-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/smooth/ftsmooth.h b/vendor/freetype/src/smooth/ftsmooth.h index f8bdc9938b..d7b61a9e60 100644 --- a/vendor/freetype/src/smooth/ftsmooth.h +++ b/vendor/freetype/src/smooth/ftsmooth.h @@ -4,7 +4,7 @@ * * Anti-aliasing renderer interface (specification). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/smooth/smooth.c b/vendor/freetype/src/smooth/smooth.c index 9a0b824c2a..8c5068180e 100644 --- a/vendor/freetype/src/smooth/smooth.c +++ b/vendor/freetype/src/smooth/smooth.c @@ -4,7 +4,7 @@ * * FreeType anti-aliasing rasterer module component (body only). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/svg/ftsvg.c b/vendor/freetype/src/svg/ftsvg.c index ba237f6380..35788a2d8d 100644 --- a/vendor/freetype/src/svg/ftsvg.c +++ b/vendor/freetype/src/svg/ftsvg.c @@ -4,7 +4,7 @@ * * The FreeType SVG renderer interface (body). * - * Copyright (C) 2022-2023 by + * Copyright (C) 2022-2024 by * David Turner, Robert Wilhelm, Werner Lemberg, and Moazin Khatti. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/svg/ftsvg.h b/vendor/freetype/src/svg/ftsvg.h index 9c496caa1a..623c091dc6 100644 --- a/vendor/freetype/src/svg/ftsvg.h +++ b/vendor/freetype/src/svg/ftsvg.h @@ -4,7 +4,7 @@ * * The FreeType SVG renderer interface (specification). * - * Copyright (C) 2022-2023 by + * Copyright (C) 2022-2024 by * David Turner, Robert Wilhelm, Werner Lemberg, and Moazin Khatti. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/svg/svg.c b/vendor/freetype/src/svg/svg.c index 373c28ed9a..1f1c04b2f2 100644 --- a/vendor/freetype/src/svg/svg.c +++ b/vendor/freetype/src/svg/svg.c @@ -4,7 +4,7 @@ * * FreeType SVG renderer module component (body only). * - * Copyright (C) 2022-2023 by + * Copyright (C) 2022-2024 by * David Turner, Robert Wilhelm, Werner Lemberg, and Moazin Khatti. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/svg/svgtypes.h b/vendor/freetype/src/svg/svgtypes.h index 1d608032cc..f1d6d73c54 100644 --- a/vendor/freetype/src/svg/svgtypes.h +++ b/vendor/freetype/src/svg/svgtypes.h @@ -4,7 +4,7 @@ * * The FreeType SVG renderer internal types (specification). * - * Copyright (C) 2022-2023 by + * Copyright (C) 2022-2024 by * David Turner, Robert Wilhelm, Werner Lemberg, and Moazin Khatti. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/truetype/truetype.c b/vendor/freetype/src/truetype/truetype.c index fcc0ea334f..fe9cb9247a 100644 --- a/vendor/freetype/src/truetype/truetype.c +++ b/vendor/freetype/src/truetype/truetype.c @@ -4,7 +4,7 @@ * * FreeType TrueType driver component (body only). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/truetype/ttdriver.c b/vendor/freetype/src/truetype/ttdriver.c index d1496fec7f..4ab68eb9a1 100644 --- a/vendor/freetype/src/truetype/ttdriver.c +++ b/vendor/freetype/src/truetype/ttdriver.c @@ -4,7 +4,7 @@ * * TrueType font driver implementation (body). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -217,7 +217,20 @@ kerning->y = 0; if ( sfnt ) - kerning->x = sfnt->get_kerning( ttface, left_glyph, right_glyph ); + { + /* Use 'kern' table if available since that can be faster; otherwise */ + /* use GPOS kerning pairs if available. */ + if ( ttface->kern_avail_bits != 0 ) + kerning->x = sfnt->get_kerning( ttface, + left_glyph, + right_glyph ); +#ifdef TT_CONFIG_OPTION_GPOS_KERNING + else if ( ttface->gpos_kerning_available ) + kerning->x = sfnt->get_gpos_kerning( ttface, + left_glyph, + right_glyph ); +#endif + } return 0; } diff --git a/vendor/freetype/src/truetype/ttdriver.h b/vendor/freetype/src/truetype/ttdriver.h index 757a66f425..3e1cf234fc 100644 --- a/vendor/freetype/src/truetype/ttdriver.h +++ b/vendor/freetype/src/truetype/ttdriver.h @@ -4,7 +4,7 @@ * * High-level TrueType driver interface (specification). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/truetype/tterrors.h b/vendor/freetype/src/truetype/tterrors.h index 008ee99853..7ad937bd04 100644 --- a/vendor/freetype/src/truetype/tterrors.h +++ b/vendor/freetype/src/truetype/tterrors.h @@ -4,7 +4,7 @@ * * TrueType error codes (specification only). * - * Copyright (C) 2001-2023 by + * Copyright (C) 2001-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/truetype/ttgload.c b/vendor/freetype/src/truetype/ttgload.c index dc427e8a11..b656ccf04e 100644 --- a/vendor/freetype/src/truetype/ttgload.c +++ b/vendor/freetype/src/truetype/ttgload.c @@ -4,7 +4,7 @@ * * TrueType Glyph Loader (body). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -353,7 +353,8 @@ FT_Byte c, count; FT_Vector *vec, *vec_limit; FT_Pos x, y; - FT_Short *cont, *cont_limit, last; + FT_UShort *cont, *cont_limit; + FT_Int last; /* check that we can add the contours to the glyph */ @@ -372,7 +373,7 @@ last = -1; for ( ; cont < cont_limit; cont++ ) { - *cont = FT_NEXT_SHORT( p ); + *cont = FT_NEXT_USHORT( p ); if ( *cont <= last ) goto Invalid_Outline; @@ -418,11 +419,9 @@ /* and thus allocate the bytecode array size by ourselves */ if ( n_ins ) { - if ( FT_QNEW_ARRAY( exec->glyphIns, n_ins ) ) + if ( FT_DUP( exec->glyphIns, p, n_ins ) ) return error; - FT_MEM_COPY( exec->glyphIns, p, (FT_Long)n_ins ); - exec->glyphSize = n_ins; } } @@ -432,7 +431,7 @@ p += n_ins; /* reading the point tags */ - flag = (FT_Byte*)outline->tags; + flag = outline->tags; flag_limit = flag + n_points; FT_ASSERT( flag ); @@ -465,7 +464,7 @@ vec = outline->points; vec_limit = vec + n_points; - flag = (FT_Byte*)outline->tags; + flag = outline->tags; x = 0; for ( ; vec < vec_limit; vec++, flag++ ) @@ -499,7 +498,7 @@ vec = outline->points; vec_limit = vec + n_points; - flag = (FT_Byte*)outline->tags; + flag = outline->tags; y = 0; for ( ; vec < vec_limit; vec++, flag++ ) @@ -532,8 +531,8 @@ *flag = (FT_Byte)( f & ON_CURVE_POINT ); } - outline->n_points = (FT_Short)n_points; - outline->n_contours = (FT_Short)n_contours; + outline->n_points = (FT_UShort)n_points; + outline->n_contours = (FT_UShort)n_contours; load->cursor = p; @@ -754,15 +753,13 @@ FT_UInt start_point, FT_UInt start_contour ) { - zone->n_points = (FT_UShort)load->outline.n_points + 4 - - (FT_UShort)start_point; - zone->n_contours = load->outline.n_contours - - (FT_Short)start_contour; + zone->n_points = load->outline.n_points + 4 - (FT_UShort)start_point; + zone->n_contours = load->outline.n_contours - (FT_UShort)start_contour; zone->org = load->extra_points + start_point; zone->cur = load->outline.points + start_point; zone->orus = load->extra_points2 + start_point; - zone->tags = (FT_Byte*)load->outline.tags + start_point; - zone->contours = (FT_UShort*)load->outline.contours + start_contour; + zone->tags = load->outline.tags + start_point; + zone->contours = load->outline.contours + start_contour; zone->first_point = (FT_UShort)start_point; } @@ -1046,7 +1043,7 @@ current.points = gloader->base.outline.points + num_base_points; current.n_points = gloader->base.outline.n_points - - (short)num_base_points; + (FT_UShort)num_base_points; have_scale = FT_BOOL( subglyph->flags & ( WE_HAVE_A_SCALE | WE_HAVE_AN_XY_SCALE | @@ -1059,7 +1056,7 @@ /* get offset */ if ( !( subglyph->flags & ARGS_ARE_XY_VALUES ) ) { - FT_UInt num_points = (FT_UInt)gloader->base.outline.n_points; + FT_UInt num_points = gloader->base.outline.n_points; FT_UInt k = (FT_UInt)subglyph->arg1; FT_UInt l = (FT_UInt)subglyph->arg2; FT_Vector* p1; @@ -1721,8 +1718,8 @@ FT_List_Add( &loader->composites, node ); } - start_point = (FT_UInt)gloader->base.outline.n_points; - start_contour = (FT_UInt)gloader->base.outline.n_contours; + start_point = gloader->base.outline.n_points; + start_contour = gloader->base.outline.n_contours; /* for each subglyph, read composite header */ error = face->read_composite_glyph( loader ); @@ -1741,14 +1738,14 @@ if ( FT_IS_NAMED_INSTANCE( FT_FACE( face ) ) || FT_IS_VARIATION( FT_FACE( face ) ) ) { - short i, limit; + FT_UShort i, limit; FT_SubGlyph subglyph; FT_Outline outline = { 0, 0, NULL, NULL, NULL, 0 }; FT_Vector* unrounded = NULL; - limit = (short)gloader->current.num_subglyphs; + limit = (FT_UShort)gloader->current.num_subglyphs; /* construct an outline structure for */ /* communication with `TT_Vary_Apply_Glyph_Deltas' */ @@ -1874,7 +1871,7 @@ linear_hadvance = loader->linear; linear_vadvance = loader->vadvance; - num_base_points = (FT_UInt)gloader->base.outline.n_points; + num_base_points = gloader->base.outline.n_points; error = load_truetype_glyph( loader, (FT_UInt)subglyph->index, @@ -1898,7 +1895,7 @@ loader->vadvance = linear_vadvance; } - num_points = (FT_UInt)gloader->base.outline.n_points; + num_points = gloader->base.outline.n_points; if ( num_points == num_base_points ) continue; @@ -2313,7 +2310,7 @@ * * 1) we have a `tricky' font that heavily relies on the interpreter to * render glyphs correctly, for example DFKai-SB, or - * 2) FT_RENDER_MODE_MONO (i.e, monochome rendering) is requested. + * 2) FT_RENDER_MODE_MONO (i.e, monochrome rendering) is requested. * * In those cases, backward compatibility needs to be turned off to get * correct rendering. The rendering is then completely up to the @@ -2719,7 +2716,7 @@ size->metrics->y_ppem < 24 ) glyph->outline.flags |= FT_OUTLINE_HIGH_PRECISION; - FT_TRACE1(( " subglyphs = %u, contours = %hd, points = %hd," + FT_TRACE1(( " subglyphs = %u, contours = %hu, points = %hu," " flags = 0x%.3x\n", loader.gloader->base.num_subglyphs, glyph->outline.n_contours, diff --git a/vendor/freetype/src/truetype/ttgload.h b/vendor/freetype/src/truetype/ttgload.h index f18637dce3..22ea967f30 100644 --- a/vendor/freetype/src/truetype/ttgload.h +++ b/vendor/freetype/src/truetype/ttgload.h @@ -4,7 +4,7 @@ * * TrueType Glyph Loader (specification). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/truetype/ttgxvar.c b/vendor/freetype/src/truetype/ttgxvar.c index ad4f266b27..095a72055c 100644 --- a/vendor/freetype/src/truetype/ttgxvar.c +++ b/vendor/freetype/src/truetype/ttgxvar.c @@ -4,7 +4,7 @@ * * TrueType GX Font Variation loader * - * Copyright (C) 2004-2023 by + * Copyright (C) 2004-2024 by * David Turner, Robert Wilhelm, Werner Lemberg, and George Williams. * * This file is part of the FreeType project, and may only be used, @@ -596,7 +596,7 @@ for ( j = 0; j < itemStore->axisCount; j++ ) { - FT_Short start, peak, end; + FT_Int start, peak, end; if ( FT_READ_SHORT( start ) || @@ -604,6 +604,10 @@ FT_READ_SHORT( end ) ) goto Exit; + /* immediately tag invalid ranges with special peak = 0 */ + if ( ( start < 0 && end > 0 ) || start > peak || peak > end ) + peak = 0; + axisCoords[j].startCoord = FT_fdot14ToFixed( start ); axisCoords[j].peakCoord = FT_fdot14ToFixed( peak ); axisCoords[j].endCoord = FT_fdot14ToFixed( end ); @@ -1024,6 +1028,9 @@ if ( innerIndex >= varData->itemCount ) return 0; /* Out of range. */ + if ( varData->regionIdxCount == 0 ) + return 0; /* Avoid "applying zero offset to null pointer". */ + if ( varData->regionIdxCount < 16 ) { deltaSet = deltaSetStack; @@ -1074,43 +1081,32 @@ /* inner loop steps through axes in this region */ for ( j = 0; j < itemStore->axisCount; j++, axis++ ) { - /* compute the scalar contribution of this axis; */ - /* ignore invalid ranges */ - if ( axis->startCoord > axis->peakCoord || - axis->peakCoord > axis->endCoord ) - continue; + FT_Fixed ncv = ttface->blend->normalizedcoords[j]; - else if ( axis->startCoord < 0 && - axis->endCoord > 0 && - axis->peakCoord != 0 ) - continue; - /* peak of 0 means ignore this axis */ - else if ( axis->peakCoord == 0 ) - continue; - - else if ( ttface->blend->normalizedcoords[j] == axis->peakCoord ) + /* compute the scalar contribution of this axis */ + /* with peak of 0 used for invalid axes */ + if ( axis->peakCoord == ncv || + axis->peakCoord == 0 ) continue; /* ignore this region if coords are out of range */ - else if ( ttface->blend->normalizedcoords[j] <= axis->startCoord || - ttface->blend->normalizedcoords[j] >= axis->endCoord ) + else if ( ncv <= axis->startCoord || + ncv >= axis->endCoord ) { scalar = 0; break; } /* cumulative product of all the axis scalars */ - else if ( ttface->blend->normalizedcoords[j] < axis->peakCoord ) - scalar = - FT_MulDiv( scalar, - ttface->blend->normalizedcoords[j] - axis->startCoord, - axis->peakCoord - axis->startCoord ); - else - scalar = - FT_MulDiv( scalar, - axis->endCoord - ttface->blend->normalizedcoords[j], - axis->endCoord - axis->peakCoord ); + else if ( ncv < axis->peakCoord ) + scalar = FT_MulDiv( scalar, + ncv - axis->startCoord, + axis->peakCoord - axis->startCoord ); + else /* ncv > axis->peakCoord */ + scalar = FT_MulDiv( scalar, + axis->endCoord - ncv, + axis->endCoord - axis->peakCoord ); } /* per-axis loop */ @@ -1920,32 +1916,27 @@ for ( i = 0; i < blend->num_axis; i++ ) { - FT_TRACE6(( " axis %d coordinate %.5f:\n", - i, (double)blend->normalizedcoords[i] / 65536 )); + FT_Fixed ncv = blend->normalizedcoords[i]; + + + FT_TRACE6(( " axis %d coordinate %.5f:\n", i, (double)ncv / 65536 )); /* It's not clear why (for intermediate tuples) we don't need */ /* to check against start/end -- the documentation says we don't. */ /* Similarly, it's unclear why we don't need to scale along the */ /* axis. */ - if ( tuple_coords[i] == 0 ) + if ( tuple_coords[i] == ncv ) { - FT_TRACE6(( " tuple coordinate is zero, ignore\n" )); + FT_TRACE6(( " tuple coordinate %.5f fits perfectly\n", + (double)tuple_coords[i] / 65536 )); + /* `apply' does not change */ continue; } - if ( blend->normalizedcoords[i] == 0 ) - { - FT_TRACE6(( " axis coordinate is zero, stop\n" )); - apply = 0; - break; - } - - if ( blend->normalizedcoords[i] == tuple_coords[i] ) + if ( tuple_coords[i] == 0 ) { - FT_TRACE6(( " tuple coordinate %.5f fits perfectly\n", - (double)tuple_coords[i] / 65536 )); - /* `apply' does not change */ + FT_TRACE6(( " tuple coordinate is zero, ignore\n" )); continue; } @@ -1953,27 +1944,27 @@ { /* not an intermediate tuple */ - if ( blend->normalizedcoords[i] < FT_MIN( 0, tuple_coords[i] ) || - blend->normalizedcoords[i] > FT_MAX( 0, tuple_coords[i] ) ) + if ( ( tuple_coords[i] > ncv && ncv > 0 ) || + ( tuple_coords[i] < ncv && ncv < 0 ) ) + { + FT_TRACE6(( " tuple coordinate %.5f fits\n", + (double)tuple_coords[i] / 65536 )); + apply = FT_MulDiv( apply, ncv, tuple_coords[i] ); + } + else { FT_TRACE6(( " tuple coordinate %.5f is exceeded, stop\n", (double)tuple_coords[i] / 65536 )); apply = 0; break; } - - FT_TRACE6(( " tuple coordinate %.5f fits\n", - (double)tuple_coords[i] / 65536 )); - apply = FT_MulDiv( apply, - blend->normalizedcoords[i], - tuple_coords[i] ); } else { /* intermediate tuple */ - if ( blend->normalizedcoords[i] <= im_start_coords[i] || - blend->normalizedcoords[i] >= im_end_coords[i] ) + if ( ncv <= im_start_coords[i] || + ncv >= im_end_coords[i] ) { FT_TRACE6(( " intermediate tuple range ]%.5f;%.5f[ is exceeded," " stop\n", @@ -1986,13 +1977,13 @@ FT_TRACE6(( " intermediate tuple range ]%.5f;%.5f[ fits\n", (double)im_start_coords[i] / 65536, (double)im_end_coords[i] / 65536 )); - if ( blend->normalizedcoords[i] < tuple_coords[i] ) + if ( ncv < tuple_coords[i] ) apply = FT_MulDiv( apply, - blend->normalizedcoords[i] - im_start_coords[i], + ncv - im_start_coords[i], tuple_coords[i] - im_start_coords[i] ); - else + else /* ncv > tuple_coords[i] */ apply = FT_MulDiv( apply, - im_end_coords[i] - blend->normalizedcoords[i], + im_end_coords[i] - ncv, im_end_coords[i] - tuple_coords[i] ); } } @@ -2141,11 +2132,12 @@ outerIndex, innerIndex ); - v += delta << 2; + /* Convert delta in F2DOT14 to 16.16 before adding. */ + v += MUL_INT( delta, 4 ); - /* Clamp value range. */ - v = v >= 0x10000L ? 0x10000 : v; - v = v <= -0x10000L ? -0x10000 : v; + /* Clamp value range [-1, 1]. */ + v = v >= 0x10000L ? 0x10000 : v; + v = v <= -0x10000L ? -0x10000 : v; new_normalized[i] = v; } @@ -2721,9 +2713,8 @@ FT_UInt n; - if ( FT_ALLOC( mmvar, ttface->blend->mmvar_len ) ) + if ( FT_DUP( mmvar, ttface->blend->mmvar, ttface->blend->mmvar_len ) ) goto Exit; - FT_MEM_COPY( mmvar, ttface->blend->mmvar, ttface->blend->mmvar_len ); axis_flags = (FT_UShort*)( (char*)mmvar + mmvar_size ); @@ -3533,9 +3524,10 @@ FT_ULong here; FT_UInt i, j; - FT_Fixed* tuple_coords = NULL; - FT_Fixed* im_start_coords = NULL; - FT_Fixed* im_end_coords = NULL; + FT_Fixed* peak_coords = NULL; + FT_Fixed* tuple_coords; + FT_Fixed* im_start_coords; + FT_Fixed* im_end_coords; GX_Blend blend = face->blend; @@ -3556,16 +3548,16 @@ { FT_TRACE2(( "\n" )); FT_TRACE2(( "tt_face_vary_cvt: no blend specified\n" )); - error = FT_Err_Ok; - goto Exit; + + return FT_Err_Ok; } if ( !face->cvt ) { FT_TRACE2(( "\n" )); FT_TRACE2(( "tt_face_vary_cvt: no `cvt ' table\n" )); - error = FT_Err_Ok; - goto Exit; + + return FT_Err_Ok; } error = face->goto_table( face, TTAG_cvar, stream, &table_len ); @@ -3573,15 +3565,11 @@ { FT_TRACE2(( "is missing\n" )); - error = FT_Err_Ok; - goto Exit; + return FT_Err_Ok; } if ( FT_FRAME_ENTER( table_len ) ) - { - error = FT_Err_Ok; - goto Exit; - } + return FT_Err_Ok; table_start = FT_Stream_FTell( stream ); if ( FT_GET_LONG() != 0x00010000L ) @@ -3594,11 +3582,6 @@ FT_TRACE2(( "loaded\n" )); - if ( FT_NEW_ARRAY( tuple_coords, blend->num_axis ) || - FT_NEW_ARRAY( im_start_coords, blend->num_axis ) || - FT_NEW_ARRAY( im_end_coords, blend->num_axis ) ) - goto FExit; - tupleCount = FT_GET_USHORT(); offsetToData = FT_GET_USHORT(); @@ -3634,8 +3617,12 @@ tupleCount & GX_TC_TUPLE_COUNT_MASK, ( tupleCount & GX_TC_TUPLE_COUNT_MASK ) == 1 ? "" : "s" )); - if ( FT_NEW_ARRAY( cvt_deltas, face->cvt_size ) ) - goto FExit; + if ( FT_QNEW_ARRAY( peak_coords, 3 * blend->num_axis ) || + FT_NEW_ARRAY( cvt_deltas, face->cvt_size ) ) + goto Exit; + + im_start_coords = peak_coords + blend->num_axis; + im_end_coords = im_start_coords + blend->num_axis; for ( i = 0; i < ( tupleCount & GX_TC_TUPLE_COUNT_MASK ); i++ ) { @@ -3652,32 +3639,19 @@ if ( tupleIndex & GX_TI_EMBEDDED_TUPLE_COORD ) { for ( j = 0; j < blend->num_axis; j++ ) - tuple_coords[j] = FT_fdot14ToFixed( FT_GET_SHORT() ); + peak_coords[j] = FT_fdot14ToFixed( FT_GET_SHORT() ); + tuple_coords = peak_coords; } - else if ( ( tupleIndex & GX_TI_TUPLE_INDEX_MASK ) >= blend->tuplecount ) + else if ( ( tupleIndex & GX_TI_TUPLE_INDEX_MASK ) < blend->tuplecount ) + tuple_coords = blend->tuplecoords + + ( tupleIndex & GX_TI_TUPLE_INDEX_MASK ) * blend->num_axis; + else { FT_TRACE2(( "tt_face_vary_cvt:" " invalid tuple index\n" )); error = FT_THROW( Invalid_Table ); - goto FExit; - } - else - { - if ( !blend->tuplecoords ) - { - FT_TRACE2(( "tt_face_vary_cvt:" - " no valid tuple coordinates available\n" )); - - error = FT_THROW( Invalid_Table ); - goto FExit; - } - - FT_MEM_COPY( - tuple_coords, - blend->tuplecoords + - ( tupleIndex & GX_TI_TUPLE_INDEX_MASK ) * blend->num_axis, - blend->num_axis * sizeof ( FT_Fixed ) ); + goto Exit; } if ( tupleIndex & GX_TI_INTERMEDIATE_TUPLE ) @@ -3820,22 +3794,20 @@ for ( i = 0; i < face->cvt_size; i++ ) face->cvt[i] += FT_fixedToFdot6( cvt_deltas[i] ); - FExit: - FT_FRAME_EXIT(); + /* iterate over all FT_Size objects and set `cvt_ready' to -1 */ + /* to trigger rescaling of all CVT values */ + FT_List_Iterate( &root->sizes_list, + tt_cvt_ready_iterator, + NULL ); Exit: if ( sharedpoints != ALL_POINTS ) FT_FREE( sharedpoints ); - FT_FREE( tuple_coords ); - FT_FREE( im_start_coords ); - FT_FREE( im_end_coords ); FT_FREE( cvt_deltas ); + FT_FREE( peak_coords ); - /* iterate over all FT_Size objects and set `cvt_ready' to -1 */ - /* to trigger rescaling of all CVT values */ - FT_List_Iterate( &root->sizes_list, - tt_cvt_ready_iterator, - NULL ); + FExit: + FT_FRAME_EXIT(); return error; @@ -4099,9 +4071,10 @@ FT_ULong here; FT_UInt i, j; - FT_Fixed* tuple_coords = NULL; - FT_Fixed* im_start_coords = NULL; - FT_Fixed* im_end_coords = NULL; + FT_Fixed* peak_coords = NULL; + FT_Fixed* tuple_coords; + FT_Fixed* im_start_coords; + FT_Fixed* im_end_coords; GX_Blend blend = face->blend; @@ -4136,27 +4109,17 @@ return FT_Err_Ok; } - if ( FT_NEW_ARRAY( points_org, n_points ) || - FT_NEW_ARRAY( points_out, n_points ) || - FT_NEW_ARRAY( has_delta, n_points ) ) - goto Fail1; - dataSize = blend->glyphoffsets[glyph_index + 1] - blend->glyphoffsets[glyph_index]; if ( FT_STREAM_SEEK( blend->glyphoffsets[glyph_index] ) || FT_FRAME_ENTER( dataSize ) ) - goto Fail1; + return error; glyph_start = FT_Stream_FTell( stream ); /* each set of glyph variation data is formatted similarly to `cvar' */ - if ( FT_NEW_ARRAY( tuple_coords, blend->num_axis ) || - FT_NEW_ARRAY( im_start_coords, blend->num_axis ) || - FT_NEW_ARRAY( im_end_coords, blend->num_axis ) ) - goto Fail2; - tupleCount = FT_GET_USHORT(); offsetToData = FT_GET_USHORT(); @@ -4168,7 +4131,7 @@ " invalid glyph variation array header\n" )); error = FT_THROW( Invalid_Table ); - goto Fail2; + goto FExit; } offsetToData += glyph_start; @@ -4192,9 +4155,16 @@ tupleCount & GX_TC_TUPLE_COUNT_MASK, ( tupleCount & GX_TC_TUPLE_COUNT_MASK ) == 1 ? "" : "s" )); - if ( FT_NEW_ARRAY( point_deltas_x, n_points ) || - FT_NEW_ARRAY( point_deltas_y, n_points ) ) - goto Fail3; + if ( FT_QNEW_ARRAY( peak_coords, 3 * blend->num_axis ) || + FT_NEW_ARRAY( point_deltas_x, 2 * n_points ) || + FT_QNEW_ARRAY( points_org, n_points ) || + FT_QNEW_ARRAY( points_out, n_points ) || + FT_QNEW_ARRAY( has_delta, n_points ) ) + goto Exit; + + im_start_coords = peak_coords + blend->num_axis; + im_end_coords = im_start_coords + blend->num_axis; + point_deltas_y = point_deltas_x + n_points; for ( j = 0; j < n_points; j++ ) { @@ -4217,22 +4187,20 @@ if ( tupleIndex & GX_TI_EMBEDDED_TUPLE_COORD ) { for ( j = 0; j < blend->num_axis; j++ ) - tuple_coords[j] = FT_fdot14ToFixed( FT_GET_SHORT() ); + peak_coords[j] = FT_fdot14ToFixed( FT_GET_SHORT() ); + tuple_coords = peak_coords; } - else if ( ( tupleIndex & GX_TI_TUPLE_INDEX_MASK ) >= blend->tuplecount ) + else if ( ( tupleIndex & GX_TI_TUPLE_INDEX_MASK ) < blend->tuplecount ) + tuple_coords = blend->tuplecoords + + ( tupleIndex & GX_TI_TUPLE_INDEX_MASK ) * blend->num_axis; + else { FT_TRACE2(( "TT_Vary_Apply_Glyph_Deltas:" " invalid tuple index\n" )); error = FT_THROW( Invalid_Table ); - goto Fail3; + goto Exit; } - else - FT_MEM_COPY( - tuple_coords, - blend->tuplecoords + - ( tupleIndex & GX_TI_TUPLE_INDEX_MASK ) * blend->num_axis, - blend->num_axis * sizeof ( FT_Fixed ) ); if ( tupleIndex & GX_TI_INTERMEDIATE_TUPLE ) { @@ -4460,23 +4428,17 @@ unrounded[n_points - 2].y ) / 64; } - Fail3: - FT_FREE( point_deltas_x ); - FT_FREE( point_deltas_y ); - - Fail2: + Exit: if ( sharedpoints != ALL_POINTS ) FT_FREE( sharedpoints ); - FT_FREE( tuple_coords ); - FT_FREE( im_start_coords ); - FT_FREE( im_end_coords ); - - FT_FRAME_EXIT(); - - Fail1: FT_FREE( points_org ); FT_FREE( points_out ); FT_FREE( has_delta ); + FT_FREE( peak_coords ); + FT_FREE( point_deltas_x ); + + FExit: + FT_FRAME_EXIT(); return error; } diff --git a/vendor/freetype/src/truetype/ttgxvar.h b/vendor/freetype/src/truetype/ttgxvar.h index e3da6d1705..9326011e3a 100644 --- a/vendor/freetype/src/truetype/ttgxvar.h +++ b/vendor/freetype/src/truetype/ttgxvar.h @@ -4,7 +4,7 @@ * * TrueType GX Font Variation loader (specification) * - * Copyright (C) 2004-2023 by + * Copyright (C) 2004-2024 by * David Turner, Robert Wilhelm, Werner Lemberg and George Williams. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/truetype/ttinterp.c b/vendor/freetype/src/truetype/ttinterp.c index 79df4555d9..951891dbf5 100644 --- a/vendor/freetype/src/truetype/ttinterp.c +++ b/vendor/freetype/src/truetype/ttinterp.c @@ -4,7 +4,7 @@ * * TrueType bytecode interpreter (body). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -5270,11 +5270,11 @@ FT_UShort refp; FT_F26Dot6 dx, dy; - FT_Short contour, bounds; + FT_UShort contour, bounds; FT_UShort start, limit, i; - contour = (FT_Short)args[0]; + contour = (FT_UShort)args[0]; bounds = ( exc->GS.gep2 == 0 ) ? 1 : exc->zp2.n_contours; if ( BOUNDS( contour, bounds ) ) @@ -5290,15 +5290,13 @@ if ( contour == 0 ) start = 0; else - start = (FT_UShort)( exc->zp2.contours[contour - 1] + 1 - - exc->zp2.first_point ); + start = exc->zp2.contours[contour - 1] + 1 - exc->zp2.first_point; /* we use the number of points if in the twilight zone */ if ( exc->GS.gep2 == 0 ) limit = exc->zp2.n_points; else - limit = (FT_UShort)( exc->zp2.contours[contour] - - exc->zp2.first_point + 1 ); + limit = exc->zp2.contours[contour] + 1 - exc->zp2.first_point; for ( i = start; i < limit; i++ ) { @@ -5341,9 +5339,9 @@ /* Normal zone's `n_points' includes phantoms, so must */ /* use end of last contour. */ if ( exc->GS.gep2 == 0 ) - limit = (FT_UShort)exc->zp2.n_points; + limit = exc->zp2.n_points; else if ( exc->GS.gep2 == 1 && exc->zp2.n_contours > 0 ) - limit = (FT_UShort)( exc->zp2.contours[exc->zp2.n_contours - 1] + 1 ); + limit = exc->zp2.contours[exc->zp2.n_contours - 1] + 1; else limit = 0; diff --git a/vendor/freetype/src/truetype/ttinterp.h b/vendor/freetype/src/truetype/ttinterp.h index e98e258fe7..4f1a9bbc67 100644 --- a/vendor/freetype/src/truetype/ttinterp.h +++ b/vendor/freetype/src/truetype/ttinterp.h @@ -4,7 +4,7 @@ * * TrueType bytecode interpreter (specification). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/truetype/ttobjs.c b/vendor/freetype/src/truetype/ttobjs.c index 5b56af711d..08aee62a8b 100644 --- a/vendor/freetype/src/truetype/ttobjs.c +++ b/vendor/freetype/src/truetype/ttobjs.c @@ -4,7 +4,7 @@ * * Objects manager (body). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -115,7 +115,7 @@ FT_LOCAL_DEF( FT_Error ) tt_glyphzone_new( FT_Memory memory, FT_UShort maxPoints, - FT_Short maxContours, + FT_UShort maxContours, TT_GlyphZone zone ) { FT_Error error; @@ -152,18 +152,20 @@ static const FT_String* tt_skip_pdffont_random_tag( const FT_String* name ) { - unsigned int i; - - - if ( ft_strlen( name ) < 8 || name[6] != '+' ) - return name; - - for ( i = 0; i < 6; i++ ) - if ( !ft_isupper( name[i] ) ) - return name; + if ( ft_isupper( name[0] ) && + ft_isupper( name[1] ) && + ft_isupper( name[2] ) && + ft_isupper( name[3] ) && + ft_isupper( name[4] ) && + ft_isupper( name[5] ) && + '+' == name[6] && + name[7] ) + { + FT_TRACE7(( "name without randomization tag: %s\n", name + 7 )); + return name + 7; + } - FT_TRACE7(( "name without randomization tag: %s\n", name + 7 )); - return name + 7; + return name; } @@ -254,17 +256,20 @@ { FT_Error error; FT_UInt32 checksum = 0; - FT_UInt i; + FT_Byte* p; + FT_Int shift; if ( FT_FRAME_ENTER( length ) ) return 0; + p = (FT_Byte*)stream->cursor; + for ( ; length > 3; length -= 4 ) - checksum += (FT_UInt32)FT_GET_ULONG(); + checksum += FT_NEXT_ULONG( p ); - for ( i = 3; length > 0; length--, i-- ) - checksum += (FT_UInt32)FT_GET_BYTE() << ( i * 8 ); + for ( shift = 24; length > 0; length--, shift -=8 ) + checksum += (FT_UInt32)FT_NEXT_BYTE( p ) << shift; FT_FRAME_EXIT(); @@ -782,8 +787,7 @@ FT_UInt instance_index = (FT_UInt)face_index >> 16; - if ( FT_HAS_MULTIPLE_MASTERS( ttface ) && - instance_index > 0 ) + if ( FT_HAS_MULTIPLE_MASTERS( ttface ) ) { error = FT_Set_Named_Instance( ttface, instance_index ); if ( error ) diff --git a/vendor/freetype/src/truetype/ttobjs.h b/vendor/freetype/src/truetype/ttobjs.h index 40eb37b4c4..9c36ca7836 100644 --- a/vendor/freetype/src/truetype/ttobjs.h +++ b/vendor/freetype/src/truetype/ttobjs.h @@ -4,7 +4,7 @@ * * Objects manager (specification). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -105,7 +105,7 @@ FT_BEGIN_HEADER FT_LOCAL( FT_Error ) tt_glyphzone_new( FT_Memory memory, FT_UShort maxPoints, - FT_Short maxContours, + FT_UShort maxContours, TT_GlyphZone zone ); #endif /* TT_USE_BYTECODE_INTERPRETER */ diff --git a/vendor/freetype/src/truetype/ttpload.c b/vendor/freetype/src/truetype/ttpload.c index 54a64c7b46..9505b5f179 100644 --- a/vendor/freetype/src/truetype/ttpload.c +++ b/vendor/freetype/src/truetype/ttpload.c @@ -4,7 +4,7 @@ * * TrueType-specific tables loader (body). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/truetype/ttpload.h b/vendor/freetype/src/truetype/ttpload.h index ed229fa461..bc32b58020 100644 --- a/vendor/freetype/src/truetype/ttpload.h +++ b/vendor/freetype/src/truetype/ttpload.h @@ -4,7 +4,7 @@ * * TrueType-specific tables loader (specification). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/type1/t1afm.c b/vendor/freetype/src/type1/t1afm.c index d9b9398b01..a63cd4dc48 100644 --- a/vendor/freetype/src/type1/t1afm.c +++ b/vendor/freetype/src/type1/t1afm.c @@ -4,7 +4,7 @@ * * AFM support for Type 1 fonts (body). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/type1/t1afm.h b/vendor/freetype/src/type1/t1afm.h index e0d5aa5a88..7f5cdda191 100644 --- a/vendor/freetype/src/type1/t1afm.h +++ b/vendor/freetype/src/type1/t1afm.h @@ -4,7 +4,7 @@ * * AFM support for Type 1 fonts (specification). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/type1/t1driver.c b/vendor/freetype/src/type1/t1driver.c index a4cdf372a9..8ed01914a5 100644 --- a/vendor/freetype/src/type1/t1driver.c +++ b/vendor/freetype/src/type1/t1driver.c @@ -4,7 +4,7 @@ * * Type 1 driver interface (body). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -312,10 +312,7 @@ { retval = ft_strlen( type1->glyph_names[idx] ) + 1; if ( value && value_len >= retval ) - { ft_memcpy( value, (void *)( type1->glyph_names[idx] ), retval ); - ((FT_Char *)value)[retval - 1] = (FT_Char)'\0'; - } } break; @@ -344,11 +341,8 @@ { retval = ft_strlen( type1->encoding.char_name[idx] ) + 1; if ( value && value_len >= retval ) - { ft_memcpy( value, (void *)( type1->encoding.char_name[idx] ), - retval - 1 ); - ((FT_Char *)value)[retval - 1] = (FT_Char)'\0'; - } + retval ); } break; diff --git a/vendor/freetype/src/type1/t1driver.h b/vendor/freetype/src/type1/t1driver.h index ee7fcf43e0..5ff52b55b1 100644 --- a/vendor/freetype/src/type1/t1driver.h +++ b/vendor/freetype/src/type1/t1driver.h @@ -4,7 +4,7 @@ * * High-level Type 1 driver interface (specification). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/type1/t1errors.h b/vendor/freetype/src/type1/t1errors.h index 2fbd1e513f..8aeb24ae18 100644 --- a/vendor/freetype/src/type1/t1errors.h +++ b/vendor/freetype/src/type1/t1errors.h @@ -4,7 +4,7 @@ * * Type 1 error codes (specification only). * - * Copyright (C) 2001-2023 by + * Copyright (C) 2001-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/type1/t1gload.c b/vendor/freetype/src/type1/t1gload.c index a32a4649d6..c29e682510 100644 --- a/vendor/freetype/src/type1/t1gload.c +++ b/vendor/freetype/src/type1/t1gload.c @@ -4,7 +4,7 @@ * * Type 1 Glyph Loader (body). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/type1/t1gload.h b/vendor/freetype/src/type1/t1gload.h index c06484758a..17a6a5941e 100644 --- a/vendor/freetype/src/type1/t1gload.h +++ b/vendor/freetype/src/type1/t1gload.h @@ -4,7 +4,7 @@ * * Type 1 Glyph Loader (specification). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/type1/t1load.c b/vendor/freetype/src/type1/t1load.c index be7cd0fd5e..ee7fb42a51 100644 --- a/vendor/freetype/src/type1/t1load.c +++ b/vendor/freetype/src/type1/t1load.c @@ -4,7 +4,7 @@ * * Type 1 font loader (body). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -751,6 +751,7 @@ PS_DesignMap dmap = blend->design_map + n; + FT_FREE( dmap->blend_points ); FT_FREE( dmap->design_points ); dmap->num_points = 0; } @@ -1043,9 +1044,9 @@ } /* allocate design map data */ - if ( FT_QNEW_ARRAY( map->design_points, num_points * 2 ) ) + if ( FT_QNEW_ARRAY( map->design_points, num_points ) || + FT_QNEW_ARRAY( map->blend_points, num_points ) ) goto Exit; - map->blend_points = map->design_points + num_points; map->num_points = (FT_Byte)num_points; for ( p = 0; p < num_points; p++ ) @@ -1876,9 +1877,8 @@ } /* t1_decrypt() shouldn't write to base -- make temporary copy */ - if ( FT_QALLOC( temp, size ) ) + if ( FT_DUP( temp, base, size ) ) goto Fail; - FT_MEM_COPY( temp, base, size ); psaux->t1_decrypt( temp, size, 4330 ); size -= (FT_ULong)t1face->type1.private_dict.lenIV; error = T1_Add_Table( table, @@ -2090,9 +2090,8 @@ } /* t1_decrypt() shouldn't write to base -- make temporary copy */ - if ( FT_QALLOC( temp, size ) ) + if ( FT_DUP( temp, base, size ) ) goto Fail; - FT_MEM_COPY( temp, base, size ); psaux->t1_decrypt( temp, size, 4330 ); size -= (FT_ULong)t1face->type1.private_dict.lenIV; error = T1_Add_Table( code_table, @@ -2284,7 +2283,7 @@ T1_FIELD_DICT_PRIVATE ) #endif - { 0, T1_FIELD_LOCATION_CID_INFO, T1_FIELD_TYPE_NONE, 0, 0, 0, 0, 0, 0 } + T1_FIELD_ZERO }; @@ -2392,18 +2391,13 @@ T1_Field keyword = (T1_Field)t1_keywords; - for (;;) + while ( keyword->len ) { - FT_Byte* name; + FT_Byte* name = (FT_Byte*)keyword->ident; - name = (FT_Byte*)keyword->ident; - if ( !name ) - break; - - if ( cur[0] == name[0] && - len == ft_strlen( (const char *)name ) && - ft_memcmp( cur, name, len ) == 0 ) + if ( keyword->len == len && + ft_memcmp( cur, name, len ) == 0 ) { /* We found it -- run the parsing callback! */ /* We record every instance of every field */ diff --git a/vendor/freetype/src/type1/t1load.h b/vendor/freetype/src/type1/t1load.h index d8c9d2d8ab..a45efa7cb7 100644 --- a/vendor/freetype/src/type1/t1load.h +++ b/vendor/freetype/src/type1/t1load.h @@ -4,7 +4,7 @@ * * Type 1 font loader (specification). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/type1/t1objs.c b/vendor/freetype/src/type1/t1objs.c index 69e4fd5065..b1b27c31fe 100644 --- a/vendor/freetype/src/type1/t1objs.c +++ b/vendor/freetype/src/type1/t1objs.c @@ -4,7 +4,7 @@ * * Type 1 objects manager (body). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/type1/t1objs.h b/vendor/freetype/src/type1/t1objs.h index 03847b27e9..3809370c1e 100644 --- a/vendor/freetype/src/type1/t1objs.h +++ b/vendor/freetype/src/type1/t1objs.h @@ -4,7 +4,7 @@ * * Type 1 objects manager (specification). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/type1/t1parse.c b/vendor/freetype/src/type1/t1parse.c index 6dec6c16c3..3717ea7c57 100644 --- a/vendor/freetype/src/type1/t1parse.c +++ b/vendor/freetype/src/type1/t1parse.c @@ -4,7 +4,7 @@ * * Type 1 parser (body). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/type1/t1parse.h b/vendor/freetype/src/type1/t1parse.h index 0d9a2865df..a0a2134d45 100644 --- a/vendor/freetype/src/type1/t1parse.h +++ b/vendor/freetype/src/type1/t1parse.h @@ -4,7 +4,7 @@ * * Type 1 parser (specification). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/type1/t1tokens.h b/vendor/freetype/src/type1/t1tokens.h index 40f3609262..5a3d2f1ef0 100644 --- a/vendor/freetype/src/type1/t1tokens.h +++ b/vendor/freetype/src/type1/t1tokens.h @@ -4,7 +4,7 @@ * * Type 1 tokenizer (specification). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/type1/type1.c b/vendor/freetype/src/type1/type1.c index d9bd8cad92..d7ff53c799 100644 --- a/vendor/freetype/src/type1/type1.c +++ b/vendor/freetype/src/type1/type1.c @@ -4,7 +4,7 @@ * * FreeType Type 1 driver component (body only). * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/type42/t42drivr.c b/vendor/freetype/src/type42/t42drivr.c index ee5fd44a9f..25f507f150 100644 --- a/vendor/freetype/src/type42/t42drivr.c +++ b/vendor/freetype/src/type42/t42drivr.c @@ -4,7 +4,7 @@ * * High-level Type 42 driver interface (body). * - * Copyright (C) 2002-2023 by + * Copyright (C) 2002-2024 by * Roberto Alameda. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/type42/t42drivr.h b/vendor/freetype/src/type42/t42drivr.h index ec7da18ccf..5b3852b864 100644 --- a/vendor/freetype/src/type42/t42drivr.h +++ b/vendor/freetype/src/type42/t42drivr.h @@ -4,7 +4,7 @@ * * High-level Type 42 driver interface (specification). * - * Copyright (C) 2002-2023 by + * Copyright (C) 2002-2024 by * Roberto Alameda. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/type42/t42error.h b/vendor/freetype/src/type42/t42error.h index dcea9c4f66..f52205e2f0 100644 --- a/vendor/freetype/src/type42/t42error.h +++ b/vendor/freetype/src/type42/t42error.h @@ -4,7 +4,7 @@ * * Type 42 error codes (specification only). * - * Copyright (C) 2002-2023 by + * Copyright (C) 2002-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/type42/t42objs.c b/vendor/freetype/src/type42/t42objs.c index bf4028e751..7010ba86ed 100644 --- a/vendor/freetype/src/type42/t42objs.c +++ b/vendor/freetype/src/type42/t42objs.c @@ -4,7 +4,7 @@ * * Type 42 objects manager (body). * - * Copyright (C) 2002-2023 by + * Copyright (C) 2002-2024 by * Roberto Alameda. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/type42/t42objs.h b/vendor/freetype/src/type42/t42objs.h index 33e6215e10..3ca83bc54e 100644 --- a/vendor/freetype/src/type42/t42objs.h +++ b/vendor/freetype/src/type42/t42objs.h @@ -4,7 +4,7 @@ * * Type 42 objects manager (specification). * - * Copyright (C) 2002-2023 by + * Copyright (C) 2002-2024 by * Roberto Alameda. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/type42/t42parse.c b/vendor/freetype/src/type42/t42parse.c index f96a43b14d..e53d352873 100644 --- a/vendor/freetype/src/type42/t42parse.c +++ b/vendor/freetype/src/type42/t42parse.c @@ -4,7 +4,7 @@ * * Type 42 font parser (body). * - * Copyright (C) 2002-2023 by + * Copyright (C) 2002-2024 by * Roberto Alameda. * * This file is part of the FreeType project, and may only be used, @@ -99,7 +99,7 @@ T1_FIELD_CALLBACK( "CharStrings", t42_parse_charstrings, 0 ) T1_FIELD_CALLBACK( "sfnts", t42_parse_sfnts, 0 ) - { 0, T1_FIELD_LOCATION_CID_INFO, T1_FIELD_TYPE_NONE, 0, 0, 0, 0, 0, 0 } + T1_FIELD_ZERO }; @@ -1195,8 +1195,6 @@ { T42_Parser parser = &loader->parser; FT_Byte* limit; - FT_Int n_keywords = (FT_Int)( sizeof ( t42_keywords ) / - sizeof ( t42_keywords[0] ) ); parser->root.cursor = base; @@ -1273,24 +1271,20 @@ if ( len > 0 && len < 22 && parser->root.cursor < limit ) { - int i; + T1_Field keyword = (T1_Field)t42_keywords; /* now compare the immediate name to the keyword table */ - - /* loop through all known keywords */ - for ( i = 0; i < n_keywords; i++ ) + while ( keyword->len ) { - T1_Field keyword = (T1_Field)&t42_keywords[i]; - FT_Byte *name = (FT_Byte*)keyword->ident; + FT_Byte* name = (FT_Byte*)keyword->ident; if ( !name ) continue; - if ( cur[0] == name[0] && - len == ft_strlen( (const char *)name ) && - ft_memcmp( cur, name, len ) == 0 ) + if ( keyword->len == len && + ft_memcmp( cur, name, len ) == 0 ) { /* we found it -- run the parsing callback! */ parser->root.error = t42_load_keyword( face, @@ -1300,6 +1294,8 @@ return parser->root.error; break; } + + keyword++; } } } diff --git a/vendor/freetype/src/type42/t42parse.h b/vendor/freetype/src/type42/t42parse.h index 5741c54137..e977861624 100644 --- a/vendor/freetype/src/type42/t42parse.h +++ b/vendor/freetype/src/type42/t42parse.h @@ -4,7 +4,7 @@ * * Type 42 font parser (specification). * - * Copyright (C) 2002-2023 by + * Copyright (C) 2002-2024 by * Roberto Alameda. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/type42/t42types.h b/vendor/freetype/src/type42/t42types.h index 0bfe14ee4d..550cc07ca1 100644 --- a/vendor/freetype/src/type42/t42types.h +++ b/vendor/freetype/src/type42/t42types.h @@ -4,7 +4,7 @@ * * Type 42 font data types (specification only). * - * Copyright (C) 2002-2023 by + * Copyright (C) 2002-2024 by * Roberto Alameda. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/type42/type42.c b/vendor/freetype/src/type42/type42.c index 8d2302c8e6..a9444f0f50 100644 --- a/vendor/freetype/src/type42/type42.c +++ b/vendor/freetype/src/type42/type42.c @@ -4,7 +4,7 @@ * * FreeType Type 42 driver component. * - * Copyright (C) 2002-2023 by + * Copyright (C) 2002-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/winfonts/fnterrs.h b/vendor/freetype/src/winfonts/fnterrs.h index dafdb07b4e..7ca6592397 100644 --- a/vendor/freetype/src/winfonts/fnterrs.h +++ b/vendor/freetype/src/winfonts/fnterrs.h @@ -4,7 +4,7 @@ * * Win FNT/FON error codes (specification only). * - * Copyright (C) 2001-2023 by + * Copyright (C) 2001-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/vendor/freetype/src/winfonts/winfnt.c b/vendor/freetype/src/winfonts/winfnt.c index 1160e4ef36..1a0f019495 100644 --- a/vendor/freetype/src/winfonts/winfnt.c +++ b/vendor/freetype/src/winfonts/winfnt.c @@ -4,7 +4,7 @@ * * FreeType font driver for Windows FNT/FON files * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * Copyright 2003 Huw D M Davies for Codeweavers * Copyright 2007 Dmitry Timoshkov for Codeweavers diff --git a/vendor/freetype/src/winfonts/winfnt.h b/vendor/freetype/src/winfonts/winfnt.h index 2f75b9e86c..78137496f9 100644 --- a/vendor/freetype/src/winfonts/winfnt.h +++ b/vendor/freetype/src/winfonts/winfnt.h @@ -4,7 +4,7 @@ * * FreeType font driver for Windows FNT/FON files * - * Copyright (C) 1996-2023 by + * Copyright (C) 1996-2024 by * David Turner, Robert Wilhelm, and Werner Lemberg. * Copyright 2007 Dmitry Timoshkov for Codeweavers * diff --git a/vendor/nvapi/NvApiDriverSettings.c b/vendor/nvapi/NvApiDriverSettings.c index ea117a30cc..b4eb350104 100644 --- a/vendor/nvapi/NvApiDriverSettings.c +++ b/vendor/nvapi/NvApiDriverSettings.c @@ -688,13 +688,6 @@ EValues_WKS_API_STEREO_MODE g_valuesWKS_API_STEREO_MODE[WKS_API_STEREO_MODE_NUM_ WKS_API_STEREO_MODE_DEFAULT_GL, }; -EValues_WKS_MEMORY_ALLOCATION_POLICY g_valuesWKS_MEMORY_ALLOCATION_POLICY[WKS_MEMORY_ALLOCATION_POLICY_NUM_VALUES] = -{ - WKS_MEMORY_ALLOCATION_POLICY_AS_NEEDED, - WKS_MEMORY_ALLOCATION_POLICY_MODERATE_PRE_ALLOCATION, - WKS_MEMORY_ALLOCATION_POLICY_AGGRESSIVE_PRE_ALLOCATION, -}; - EValues_WKS_STEREO_DONGLE_SUPPORT g_valuesWKS_STEREO_DONGLE_SUPPORT[WKS_STEREO_DONGLE_SUPPORT_NUM_VALUES] = { WKS_STEREO_DONGLE_SUPPORT_OFF, @@ -768,30 +761,6 @@ EValues_PS_SHADERDISKCACHE g_valuesPS_SHADERDISKCACHE[PS_SHADERDISKCACHE_NUM_VAL PS_SHADERDISKCACHE_ON, }; -EValues_PS_SHADERDISKCACHE_FLAGS g_valuesPS_SHADERDISKCACHE_FLAGS[PS_SHADERDISKCACHE_FLAGS_NUM_VALUES] = -{ - PS_SHADERDISKCACHE_FLAGS_DISABLE_DEFAULT_COMPILES, - PS_SHADERDISKCACHE_FLAGS_DISABLE_OPTIONAL_COMPILES, - PS_SHADERDISKCACHE_FLAGS_DISABLE_DRIVER_VERSIONING, - PS_SHADERDISKCACHE_FLAGS_DUMP_HISTOGRAM, - PS_SHADERDISKCACHE_FLAGS_DUMP_TIMELINE, - PS_SHADERDISKCACHE_FLAGS_DISABLE_GARBAGE_COLLECTION, - PS_SHADERDISKCACHE_FLAGS_ENABLE_ENCRYPTION, - PS_SHADERDISKCACHE_FLAGS_DISABLE_CRC, - PS_SHADERDISKCACHE_FLAGS_ENABLE_STATS_FILES, - PS_SHADERDISKCACHE_FLAGS_DISABLE_STATS_RESET, - PS_SHADERDISKCACHE_FLAGS_DISABLE_DEBUG_FORCED_COMPILE, - PS_SHADERDISKCACHE_FLAGS_NO_COMPRESSION, - PS_SHADERDISKCACHE_FLAGS_RLE_COMPRESSION, - PS_SHADERDISKCACHE_FLAGS_LZMA_COMPRESSION, - PS_SHADERDISKCACHE_FLAGS_BACKEND_MEM_MAP_FILES, - PS_SHADERDISKCACHE_FLAGS_BACKEND_DLL, - PS_SHADERDISKCACHE_FLAGS_FLOOD_CACHE_DIRECTORY, - PS_SHADERDISKCACHE_FLAGS_DISABLE_DEDUPLICATION, - PS_SHADERDISKCACHE_FLAGS_DELETE_PERFECT_CACHES, - PS_SHADERDISKCACHE_FLAGS_ALL_BUILDS_MISMATCH_TEST, -}; - EValues_PS_SHADERDISKCACHE_MAX_SIZE g_valuesPS_SHADERDISKCACHE_MAX_SIZE[PS_SHADERDISKCACHE_MAX_SIZE_NUM_VALUES] = { PS_SHADERDISKCACHE_MAX_SIZE_MIN, @@ -952,7 +921,6 @@ SettingDWORDNameString mapSettingDWORD[TOTAL_DWORD_SETTING_NUM] = {VSYNC_BEHAVIOR_FLAGS_ID, VSYNC_BEHAVIOR_FLAGS_STRING, 3, (NvU32 *)g_valuesVSYNC_BEHAVIOR_FLAGS, VSYNC_BEHAVIOR_FLAGS_DEFAULT}, {WKS_API_STEREO_EYES_EXCHANGE_ID, WKS_API_STEREO_EYES_EXCHANGE_STRING, 2, (NvU32 *)g_valuesWKS_API_STEREO_EYES_EXCHANGE, WKS_API_STEREO_EYES_EXCHANGE_OFF}, {WKS_API_STEREO_MODE_ID, WKS_API_STEREO_MODE_STRING, 25, (NvU32 *)g_valuesWKS_API_STEREO_MODE, WKS_API_STEREO_MODE_SHUTTER_GLASSES}, - {WKS_MEMORY_ALLOCATION_POLICY_ID, WKS_MEMORY_ALLOCATION_POLICY_STRING, 3, (NvU32 *)g_valuesWKS_MEMORY_ALLOCATION_POLICY, WKS_MEMORY_ALLOCATION_POLICY_AS_NEEDED}, {WKS_STEREO_DONGLE_SUPPORT_ID, WKS_STEREO_DONGLE_SUPPORT_STRING, 3, (NvU32 *)g_valuesWKS_STEREO_DONGLE_SUPPORT, WKS_STEREO_DONGLE_SUPPORT_DAC}, {WKS_STEREO_SUPPORT_ID, WKS_STEREO_SUPPORT_STRING, 2, (NvU32 *)g_valuesWKS_STEREO_SUPPORT, WKS_STEREO_SUPPORT_OFF}, {WKS_STEREO_SWAP_MODE_ID, WKS_STEREO_SWAP_MODE_STRING, 5, (NvU32 *)g_valuesWKS_STEREO_SWAP_MODE, WKS_STEREO_SWAP_MODE_APPLICATION_CONTROL}, @@ -964,7 +932,6 @@ SettingDWORDNameString mapSettingDWORD[TOTAL_DWORD_SETTING_NUM] = {MAXWELL_B_SAMPLE_INTERLEAVE_ID, MAXWELL_B_SAMPLE_INTERLEAVE_STRING, 2, (NvU32 *)g_valuesMAXWELL_B_SAMPLE_INTERLEAVE, MAXWELL_B_SAMPLE_INTERLEAVE_OFF}, {PRERENDERLIMIT_ID, PRERENDERLIMIT_STRING, 3, (NvU32 *)g_valuesPRERENDERLIMIT, PRERENDERLIMIT_APP_CONTROLLED}, {PS_SHADERDISKCACHE_ID, PS_SHADERDISKCACHE_STRING, 2, (NvU32 *)g_valuesPS_SHADERDISKCACHE, PS_SHADERDISKCACHE_ON}, - {PS_SHADERDISKCACHE_FLAGS_ID, PS_SHADERDISKCACHE_FLAGS_STRING, 20, (NvU32 *)g_valuesPS_SHADERDISKCACHE_FLAGS, 0x00000000}, {PS_SHADERDISKCACHE_MAX_SIZE_ID, PS_SHADERDISKCACHE_MAX_SIZE_STRING, 2, (NvU32 *)g_valuesPS_SHADERDISKCACHE_MAX_SIZE, 0x00000000}, {PS_TEXFILTER_ANISO_OPTS2_ID, PS_TEXFILTER_ANISO_OPTS2_STRING, 2, (NvU32 *)g_valuesPS_TEXFILTER_ANISO_OPTS2, PS_TEXFILTER_ANISO_OPTS2_OFF}, {PS_TEXFILTER_BILINEAR_IN_ANISO_ID, PS_TEXFILTER_BILINEAR_IN_ANISO_STRING, 2, (NvU32 *)g_valuesPS_TEXFILTER_BILINEAR_IN_ANISO, PS_TEXFILTER_BILINEAR_IN_ANISO_OFF}, diff --git a/vendor/nvapi/NvApiDriverSettings.h b/vendor/nvapi/NvApiDriverSettings.h index 08e8ddc331..df1d48ac22 100644 --- a/vendor/nvapi/NvApiDriverSettings.h +++ b/vendor/nvapi/NvApiDriverSettings.h @@ -116,7 +116,6 @@ #define VSYNC_BEHAVIOR_FLAGS_STRING L"Vsync - Behavior Flags" #define WKS_API_STEREO_EYES_EXCHANGE_STRING L"Stereo - Swap eyes" #define WKS_API_STEREO_MODE_STRING L"Stereo - Display mode" -#define WKS_MEMORY_ALLOCATION_POLICY_STRING L"Memory Allocation Policy" #define WKS_STEREO_DONGLE_SUPPORT_STRING L"Stereo - Dongle Support" #define WKS_STEREO_SUPPORT_STRING L"Stereo - Enable" #define WKS_STEREO_SWAP_MODE_STRING L"Stereo - swap mode" @@ -130,7 +129,6 @@ #define PRERENDERLIMIT_STRING L"Maximum pre-rendered frames" #define PS_SHADERDISKCACHE_STRING L"Shader Cache" #define PS_SHADERDISKCACHE_DLL_PATH_WCHAR_STRING L"shader cache path to dll" -#define PS_SHADERDISKCACHE_FLAGS_STRING L"shader cache control flags" #define PS_SHADERDISKCACHE_MAX_SIZE_STRING L"Shader disk cache maximum size" #define PS_TEXFILTER_ANISO_OPTS2_STRING L"Texture filtering - Anisotropic sample optimization" #define PS_TEXFILTER_BILINEAR_IN_ANISO_STRING L"Texture filtering - Anisotropic filter optimization" @@ -221,7 +219,6 @@ enum ESetting { VSYNC_BEHAVIOR_FLAGS_ID = 0x10FDEC23, WKS_API_STEREO_EYES_EXCHANGE_ID = 0x11AE435C, WKS_API_STEREO_MODE_ID = 0x11E91A61, - WKS_MEMORY_ALLOCATION_POLICY_ID = 0x11112233, WKS_STEREO_DONGLE_SUPPORT_ID = 0x112493BD, WKS_STEREO_SUPPORT_ID = 0x11AA9E99, WKS_STEREO_SWAP_MODE_ID = 0x11333333, @@ -235,7 +232,6 @@ enum ESetting { PRERENDERLIMIT_ID = 0x007BA09E, PS_SHADERDISKCACHE_ID = 0x00198FFF, PS_SHADERDISKCACHE_DLL_PATH_WCHAR_ID = 0x0019A002, - PS_SHADERDISKCACHE_FLAGS_ID = 0x00F4889B, PS_SHADERDISKCACHE_MAX_SIZE_ID = 0x00AC8497, PS_TEXFILTER_ANISO_OPTS2_ID = 0x00E73211, PS_TEXFILTER_BILINEAR_IN_ANISO_ID = 0x0084CD70, @@ -248,9 +244,9 @@ enum ESetting { SET_VAB_DATA_ID = 0x00AB8687, VSYNCMODE_ID = 0x00A879CF, VSYNCTEARCONTROL_ID = 0x005A375C, - TOTAL_DWORD_SETTING_NUM = 98, + TOTAL_DWORD_SETTING_NUM = 96, TOTAL_WSTRING_SETTING_NUM = 5, - TOTAL_SETTING_NUM = 103, + TOTAL_SETTING_NUM = 101, INVALID_SETTING_ID = 0xFFFFFFFF }; @@ -962,14 +958,6 @@ enum EValues_WKS_API_STEREO_MODE { WKS_API_STEREO_MODE_DEFAULT = WKS_API_STEREO_MODE_SHUTTER_GLASSES }; -enum EValues_WKS_MEMORY_ALLOCATION_POLICY { - WKS_MEMORY_ALLOCATION_POLICY_AS_NEEDED = 0x0, - WKS_MEMORY_ALLOCATION_POLICY_MODERATE_PRE_ALLOCATION = 0x1, - WKS_MEMORY_ALLOCATION_POLICY_AGGRESSIVE_PRE_ALLOCATION = 0x2, - WKS_MEMORY_ALLOCATION_POLICY_NUM_VALUES = 3, - WKS_MEMORY_ALLOCATION_POLICY_DEFAULT = WKS_MEMORY_ALLOCATION_POLICY_AS_NEEDED -}; - enum EValues_WKS_STEREO_DONGLE_SUPPORT { WKS_STEREO_DONGLE_SUPPORT_OFF = 0, WKS_STEREO_DONGLE_SUPPORT_DAC = 1, @@ -1054,31 +1042,6 @@ enum EValues_PS_SHADERDISKCACHE { PS_SHADERDISKCACHE_DEFAULT = PS_SHADERDISKCACHE_ON }; -enum EValues_PS_SHADERDISKCACHE_FLAGS { - PS_SHADERDISKCACHE_FLAGS_DISABLE_DEFAULT_COMPILES = 0x00000001, - PS_SHADERDISKCACHE_FLAGS_DISABLE_OPTIONAL_COMPILES = 0x00000002, - PS_SHADERDISKCACHE_FLAGS_DISABLE_DRIVER_VERSIONING = 0x00000008, - PS_SHADERDISKCACHE_FLAGS_DUMP_HISTOGRAM = 0x00000010, - PS_SHADERDISKCACHE_FLAGS_DUMP_TIMELINE = 0x00000020, - PS_SHADERDISKCACHE_FLAGS_DISABLE_GARBAGE_COLLECTION = 0x00000040, - PS_SHADERDISKCACHE_FLAGS_ENABLE_ENCRYPTION = 0x00000080, - PS_SHADERDISKCACHE_FLAGS_DISABLE_CRC = 0x00000100, - PS_SHADERDISKCACHE_FLAGS_ENABLE_STATS_FILES = 0x00000200, - PS_SHADERDISKCACHE_FLAGS_DISABLE_STATS_RESET = 0x00000400, - PS_SHADERDISKCACHE_FLAGS_DISABLE_DEBUG_FORCED_COMPILE = 0x00000800, - PS_SHADERDISKCACHE_FLAGS_NO_COMPRESSION = 0x00001000, - PS_SHADERDISKCACHE_FLAGS_RLE_COMPRESSION = 0x00002000, - PS_SHADERDISKCACHE_FLAGS_LZMA_COMPRESSION = 0x00004000, - PS_SHADERDISKCACHE_FLAGS_BACKEND_MEM_MAP_FILES = 0x00010000, - PS_SHADERDISKCACHE_FLAGS_BACKEND_DLL = 0x00020000, - PS_SHADERDISKCACHE_FLAGS_FLOOD_CACHE_DIRECTORY = 0x00100000, - PS_SHADERDISKCACHE_FLAGS_DISABLE_DEDUPLICATION = 0x00200000, - PS_SHADERDISKCACHE_FLAGS_DELETE_PERFECT_CACHES = 0x00400000, - PS_SHADERDISKCACHE_FLAGS_ALL_BUILDS_MISMATCH_TEST = 0x00800000, - PS_SHADERDISKCACHE_FLAGS_NUM_VALUES = 20, - PS_SHADERDISKCACHE_FLAGS_DEFAULT = 0x0 -}; - enum EValues_PS_SHADERDISKCACHE_MAX_SIZE { PS_SHADERDISKCACHE_MAX_SIZE_MIN = 0x0, PS_SHADERDISKCACHE_MAX_SIZE_MAX = 0xffffffff, diff --git a/vendor/nvapi/amd64/nvapi64.lib b/vendor/nvapi/amd64/nvapi64.lib index 1483b30007..9e22c10f72 100644 Binary files a/vendor/nvapi/amd64/nvapi64.lib and b/vendor/nvapi/amd64/nvapi64.lib differ diff --git a/vendor/nvapi/nvapi.h b/vendor/nvapi/nvapi.h index 846ca2f636..ef5edfcf5f 100644 --- a/vendor/nvapi/nvapi.h +++ b/vendor/nvapi/nvapi.h @@ -41,7 +41,7 @@ /////////////////////////////////////////////////////////////////////////////// // -// Date: Feb 1, 2024 +// Date: May 30, 2024 // File: nvapi.h // // NvAPI provides an interface to NVIDIA devices. This file contains the @@ -1741,6 +1741,8 @@ NVAPI_INTERFACE NvAPI_GetPhysicalGPUsFromLogicalGPU(NvLogicalGpuHandle hLogicalG //! //! TCC_SUPPORTED //! +//! MCDM_SUPPORTED +//! //! \since Release: 80 //! //! \retval NVAPI_INVALID_ARGUMENT gpuId is zero or pPhysicalGPU is NULL @@ -1761,6 +1763,8 @@ NVAPI_INTERFACE NvAPI_GetPhysicalGPUFromGPUID(NvU32 gpuId, NvPhysicalGpuHandle * //! //! TCC_SUPPORTED //! +//! MCDM_SUPPORTED +//! //! \since Release: 95 //! //! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu is NULL or invalid. Re-enumerate the GPU handles. @@ -1782,6 +1786,8 @@ NVAPI_INTERFACE NvAPI_GetGPUIDfromPhysicalGPU(NvPhysicalGpuHandle hPhysicalGpu, //! //! TCC_SUPPORTED //! +//! MCDM_SUPPORTED +//! //! \since Release: 170 //! //! \retval NVAPI_INVALID_ARGUMENT: pCount is NULL @@ -1806,6 +1812,8 @@ NVAPI_INTERFACE NvAPI_GPU_GetShaderSubPipeCount(NvPhysicalGpuHandle hPhysicalGpu //! //! TCC_SUPPORTED //! +//! MCDM_SUPPORTED +//! //! \retval ::NVAPI_INVALID_ARGUMENT pCount is NULL //! \retval ::NVAPI_OK *pCount is set //! \retval ::NVAPI_NVIDIA_DEVICE_NOT_FOUND no NVIDIA GPU driving a display was found @@ -2092,6 +2100,8 @@ NVAPI_INTERFACE NvAPI_GPU_GetConnectedSLIOutputsWithLidState(NvPhysicalGpuHandle //! //! TCC_SUPPORTED //! +//! MCDM_SUPPORTED +//! //! \since Release: 95 //! //! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu or pOutputsMask is NULL @@ -2248,6 +2258,8 @@ NVAPI_INTERFACE NvAPI_GPU_ValidateOutputCombination(NvPhysicalGpuHandle hPhysica //! //! TCC_SUPPORTED //! +//! MCDM_SUPPORTED +//! //! \since Release: 90 //! //! \return NVAPI_ERROR or NVAPI_OK @@ -2266,6 +2278,8 @@ NVAPI_INTERFACE NvAPI_GPU_GetFullName(NvPhysicalGpuHandle hPhysicalGpu, NvAPI_Sh //! //! TCC_SUPPORTED //! +//! MCDM_SUPPORTED +//! //! \since Release: 90 //! //! \param DeviceId The internal PCI device identifier for the GPU. @@ -2306,6 +2320,8 @@ typedef enum _NV_GPU_TYPE //! //! TCC_SUPPORTED //! +//! MCDM_SUPPORTED +//! //! \since Release: 173 //! //! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu @@ -2342,6 +2358,8 @@ typedef enum _NV_GPU_BUS_TYPE //! //! TCC_SUPPORTED //! +//! MCDM_SUPPORTED +//! //! \since Release: 90 //! //! \return This API can return any of the error codes enumerated in #NvAPI_Status. If there are return error codes with @@ -2364,6 +2382,8 @@ NVAPI_INTERFACE NvAPI_GPU_GetBusType(NvPhysicalGpuHandle hPhysicalGpu,NV_GPU_BUS //! //! TCC_SUPPORTED //! +//! MCDM_SUPPORTED +//! //! \since Release: 167 //! //! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu or pBusId is NULL. @@ -2386,6 +2406,8 @@ NVAPI_INTERFACE NvAPI_GPU_GetBusId(NvPhysicalGpuHandle hPhysicalGpu, NvU32 *pBus //! //! TCC_SUPPORTED //! +//! MCDM_SUPPORTED +//! //! \since Release: 167 //! //! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu or pBusSlotId is NULL. @@ -2410,6 +2432,8 @@ NVAPI_INTERFACE NvAPI_GPU_GetBusSlotId(NvPhysicalGpuHandle hPhysicalGpu, NvU32 * //! //! TCC_SUPPORTED //! +//! MCDM_SUPPORTED +//! //! \since Release: 90 //! //! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu or pIRQ is NULL. @@ -2431,6 +2455,8 @@ NVAPI_INTERFACE NvAPI_GPU_GetIRQ(NvPhysicalGpuHandle hPhysicalGpu,NvU32 *pIRQ); //! //! TCC_SUPPORTED //! +//! MCDM_SUPPORTED +//! //! \since Release: 90 //! //! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu or pBiosRevision is NULL. @@ -2452,6 +2478,8 @@ NVAPI_INTERFACE NvAPI_GPU_GetVbiosRevision(NvPhysicalGpuHandle hPhysicalGpu,NvU3 //! //! TCC_SUPPORTED //! +//! MCDM_SUPPORTED +//! //! \since Release: 90 //! //! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu or pBiosRevision is NULL @@ -2475,6 +2503,8 @@ NVAPI_INTERFACE NvAPI_GPU_GetVbiosOEMRevision(NvPhysicalGpuHandle hPhysicalGpu,N //! //! TCC_SUPPORTED //! +//! MCDM_SUPPORTED +//! //! \since Release: 90 //! //! \retval NVAPI_INVALID_ARGUMENT hPhysicalGpu is NULL. @@ -2538,6 +2568,8 @@ NVAPI_INTERFACE NvAPI_GPU_GetCurrentAGPRate(NvPhysicalGpuHandle hPhysicalGpu,NvU //! //! TCC_SUPPORTED //! +//! MCDM_SUPPORTED +//! //! \since Release: 90 //! //! \retval NVAPI_INVALID_ARGUMENT pWidth is NULL. @@ -2562,6 +2594,8 @@ NVAPI_INTERFACE NvAPI_GPU_GetCurrentPCIEDownstreamWidth(NvPhysicalGpuHandle hPhy //! //! TCC_SUPPORTED //! +//! MCDM_SUPPORTED +//! //! \since Release: 90 //! //! \retval NVAPI_INVALID_ARGUMENT pSize is NULL @@ -2584,6 +2618,8 @@ NVAPI_INTERFACE NvAPI_GPU_GetPhysicalFrameBufferSize(NvPhysicalGpuHandle hPhysic //! //! TCC_SUPPORTED //! +//! MCDM_SUPPORTED +//! //! \since Release: 90 //! //! \retval NVAPI_INVALID_ARGUMENT pSize is NULL. @@ -2648,6 +2684,8 @@ typedef NV_BOARD_INFO_V1 NV_BOARD_INFO; //! //! TCC_SUPPORTED //! +//! MCDM_SUPPORTED +//! //! \retval ::NVAPI_OK completed request //! \retval ::NVAPI_ERROR miscellaneous error occurred //! \retval ::NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE handle passed is not a physical GPU handle @@ -2673,6 +2711,8 @@ NVAPI_INTERFACE NvAPI_GPU_GetBoardInfo(NvPhysicalGpuHandle hPhysicalGpu, NV_BOAR //! //! TCC_SUPPORTED //! +//! MCDM_SUPPORTED +//! //! \since Release: 100 //! //! \return NVAPI_ERROR or NVAPI_OK @@ -2878,6 +2918,8 @@ typedef NV_GPU_ARCH_INFO_V2 NV_GPU_ARCH_INFO; //! //! //! TCC_SUPPORTED +//! +//! MCDM_SUPPORTED //! \since Release: 85 //! //! \return This API can return any of the error codes enumerated in @@ -3141,6 +3183,8 @@ NVAPI_INTERFACE NvAPI_GPU_WorkstationFeatureQuery(__in NvPhysicalGpuHandle hPhys //! //! TCC_SUPPORTED //! +//! MCDM_SUPPORTED +//! //! \since Release: 175 //! //! \retval ::NVAPI_OK @@ -3308,6 +3352,8 @@ NVAPI_INTERFACE NvAPI_GPU_CudaEnumComputeCapableGpus(__inout NV_COMPUTE_GPU_TOPO //! //! TCC_SUPPORTED //! +//! MCDM_SUPPORTED +//! //! \param [in] hPhysicalGpu GPU selection. //! \param [out] pValue Pointer to a variable to get the tachometer reading //! @@ -3339,6 +3385,8 @@ NVAPI_INTERFACE NvAPI_GPU_GetTachReading(NvPhysicalGpuHandle hPhysicalGPU, NvU32 //! //! TCC_SUPPORTED //! +//! MCDM_SUPPORTED +//! //! \param [in] hPhysicalGpu A handle identifying the physical GPU for which ECC //! status information is to be retrieved. //! \param [out] pECCStatusInfo A pointer to an ECC status structure. @@ -3416,6 +3464,8 @@ typedef struct //! //! TCC_SUPPORTED //! +//! MCDM_SUPPORTED +//! //! \param [in] hPhysicalGpu A handle identifying the physical GPU for //! which ECC error information is to be //! retrieved. @@ -3449,6 +3499,8 @@ NVAPI_INTERFACE NvAPI_GPU_GetECCErrorInfo(NvPhysicalGpuHandle hPhysicalGpu, //! //! TCC_SUPPORTED //! +//! MCDM_SUPPORTED +//! //! \requires Administrator privileges since release 430.39 //! //! \param [in] hPhysicalGpu A handle identifying the physical GPU for @@ -3481,6 +3533,8 @@ NVAPI_INTERFACE NvAPI_GPU_ResetECCErrorInfo(NvPhysicalGpuHandle hPhysicalGpu, Nv //! //! TCC_SUPPORTED //! +//! MCDM_SUPPORTED +//! //! \param [in] hPhysicalGpu A handle identifying the physical GPU for //! which ECC configuration information //! is to be retrieved. @@ -3527,6 +3581,8 @@ NVAPI_INTERFACE NvAPI_GPU_GetECCConfigurationInfo(NvPhysicalGpuHandle hPhysicalG //! //! TCC_SUPPORTED //! +//! MCDM_SUPPORTED +//! //! \requires Administrator privileges since release 430.39 //! //! \param [in] hPhysicalGpu A handle identifying the physical GPU for @@ -4008,6 +4064,8 @@ typedef NV_GPU_VIRTUALIZATION_INFO_V1 NV_GPU_VIRTUALIZATION_INFO; //! //! TCC_SUPPORTED //! +//! MCDM_SUPPORTED +//! //! \since Release: 367 //! //! \param [in,out] pVirtualizationInfo Pointer to NV_GPU_VIRTUALIZATION_INFO structure. @@ -4224,6 +4282,8 @@ typedef NV_LICENSABLE_FEATURES_V4 NV_LICENSABLE_FEATURES; //! //! TCC_SUPPORTED //! +//! MCDM_SUPPORTED +//! //! \param [in] hPhysicalGpu GPU selection //! \param [in,out] pLicensableFeatures Licensable features information. //! @@ -4545,6 +4605,8 @@ typedef NV_GPU_INFO_V2 NV_GPU_INFO; //! //! TCC_SUPPORTED //! +//! MCDM_SUPPORTED +//! //! \since Release: 400 //! //! \param [in,out] pGpuInfo - This structure will be filled with required information. @@ -4581,6 +4643,8 @@ typedef NV_GPU_VR_READY_V1 NV_GPU_VR_READY; //! //! TCC_SUPPORTED //! +//! MCDM_SUPPORTED +//! //! \since Release: 465 //! //! \param [in,out] pGpuVrReadyData - This structure will be filled with required information. @@ -4594,6 +4658,16 @@ typedef NV_GPU_VR_READY_V1 NV_GPU_VR_READY; NVAPI_INTERFACE NvAPI_GPU_GetVRReadyData(__in NvPhysicalGpuHandle hPhysicalGpu, __inout NV_GPU_VR_READY *pGpuVrReadyData); +typedef enum _NV_ADAPTER_TYPE +{ + NV_ADAPTER_TYPE_UNKNOWN = 0x0, + NV_ADAPTER_TYPE_WDDM = NV_BIT(0), //