-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a pane for analyse Font Structure (just the prototype for now)
Can be important for check if Font Format is bad or not. regarding lat issue #7 on merged font generation. very difficult to see here is the error
- Loading branch information
Showing
4 changed files
with
145 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
// This is an open source non-commercial project. Dear PVS-Studio, please check it. | ||
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com | ||
|
||
/* | ||
* Copyright 2020 Stephane Cuillerdier (aka Aiekick) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#include "FontStructurePane.h" | ||
|
||
#include "MainFrame.h" | ||
|
||
#include "Gui/GuiLayout.h" | ||
#include "Gui/ImGuiWidgets.h" | ||
|
||
#define IMGUI_DEFINE_MATH_OPERATORS | ||
#include "imgui_internal.h" | ||
|
||
#include <cTools.h> | ||
#include <FileHelper.h> | ||
|
||
#include <cinttypes> // printf zu | ||
|
||
static int FontStructurePane_WidgetId = 0; | ||
|
||
FontStructurePane::FontStructurePane() = default; | ||
FontStructurePane::~FontStructurePane() = default; | ||
|
||
/////////////////////////////////////////////////////////////////////////////////// | ||
//// IMGUI PANE /////////////////////////////////////////////////////////////////// | ||
/////////////////////////////////////////////////////////////////////////////////// | ||
|
||
int FontStructurePane::DrawFontStructurePane(ProjectFile *vProjectFile, int vWidgetId) | ||
{ | ||
FontStructurePane_WidgetId = vWidgetId; | ||
|
||
if (GuiLayout::m_Pane_Shown & PaneFlags::PANE_FONT_STRUCTURE) | ||
{ | ||
if (ImGui::Begin<PaneFlags>(FONT_STRUCTURE_PANE, | ||
&GuiLayout::m_Pane_Shown, PaneFlags::PANE_DEBUG, | ||
//ImGuiWindowFlags_NoTitleBar | | ||
//ImGuiWindowFlags_MenuBar | | ||
//ImGuiWindowFlags_NoMove | | ||
ImGuiWindowFlags_NoCollapse | | ||
//ImGuiWindowFlags_NoResize | | ||
ImGuiWindowFlags_NoBringToFrontOnFocus)) | ||
{ | ||
if (vProjectFile && vProjectFile->IsLoaded()) | ||
{ | ||
if (ImGui::Button("Analyse Font")) | ||
{ | ||
AnalyzeFont(vProjectFile->m_ProjectFilePathName); | ||
} | ||
|
||
FontStructurePane_WidgetId = DisplayAnalyze(FontStructurePane_WidgetId); | ||
} | ||
} | ||
|
||
ImGui::End(); | ||
} | ||
|
||
return FontStructurePane_WidgetId; | ||
} | ||
|
||
/////////////////////////////////////////////////////////////////////////////////// | ||
/////////////////////////////////////////////////////////////////////////////////// | ||
/////////////////////////////////////////////////////////////////////////////////// | ||
|
||
void FontStructurePane::AnalyzeFont(const std::string& vFilePathName) | ||
{ | ||
|
||
} | ||
|
||
int FontStructurePane::DisplayAnalyze(int vWidgetId) | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Copyright 2020 Stephane Cuillerdier (aka Aiekick) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <string> | ||
|
||
class ProjectFile; | ||
class FontInfos; | ||
class FontStructurePane | ||
{ | ||
public: | ||
int DrawFontStructurePane(ProjectFile *vProjectFile, int vWidgetId); | ||
|
||
private: | ||
void AnalyzeFont(const std::string& vFilePathName); | ||
int DisplayAnalyze(int vWidgetId); | ||
|
||
public: // singleton | ||
static FontStructurePane *Instance() | ||
{ | ||
static auto *_instance = new FontStructurePane(); | ||
return _instance; | ||
} | ||
|
||
protected: | ||
FontStructurePane(); // Prevent construction | ||
FontStructurePane(const FontStructurePane&) = default; // Prevent construction by copying | ||
FontStructurePane& operator =(const FontStructurePane&) { return *this; }; // Prevent assignment | ||
~FontStructurePane(); // Prevent unwanted destruction | ||
}; |