Skip to content

Commit

Permalink
Fixed: out of bounds rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
TheNicker committed Sep 7, 2023
1 parent 2dda346 commit 5707f6f
Show file tree
Hide file tree
Showing 5 changed files with 173 additions and 152 deletions.
12 changes: 12 additions & 0 deletions FreeTypeWrapper/Include/FreeTypeWrapper/FreeTypeCommon.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#pragma once
namespace FreeType
{
enum class RenderMode
{
Default
, Aliased
, Antialiased
, SubpixelAntiAliased
};

}
22 changes: 11 additions & 11 deletions FreeTypeWrapper/Include/FreeTypeWrapper/FreeTypeConnector.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
#include <cstdint>
#include <string>

#include <FreeTypeWrapper/FreeTypeCommon.h>

#include <LLUtils/Color.h>
#include <LLUtils/Buffer.h>
#include <LLUtils/Rect.h>
#include <LLUtils/EnumClassBitwise.h>



#pragma region FreeType forward declerations

struct FT_StrokerRec_;
Expand All @@ -25,19 +26,18 @@ namespace FreeType
class FreeTypeFont;
using FreeTypeFontUniquePtr = std::unique_ptr<FreeTypeFont>;

enum class RenderMode
{
Default
, Aliased
, Antialiased
, SubpixelAntiAliased
};

enum class TextCreateFlags
{
None
, UseMetaText = 1 << 0
, Bidirectional = 1 << 1
// Use meta text for inline text style, e.g. color, size
, UseMetaText = 1 << 0
// Use bidirectional text RTL and LTR.
, Bidirectional = 1 << 1
// Add to the end of the line several pixels as descibed in the font , usefull for fixed width fonts.
, LineEndFixedWidth = 1 << 2
// Don't Generate outline bitmaps when measuring text, use an estimation.
//, OptimizeOutlineMetrics = 1 << 3
};

LLUTILS_DEFINE_ENUM_CLASS_FLAG_OPERATIONS(TextCreateFlags)
Expand Down Expand Up @@ -72,7 +72,7 @@ namespace FreeType

struct TextMetrics
{
std::vector< LineMetrics> lineMetrics;
std::vector<LineMetrics> lineMetrics;
LLUtils::RectI32 rect;
uint32_t rowHeight;
int32_t minX = std::numeric_limits<int32_t>::max();
Expand Down
Loading

0 comments on commit 5707f6f

Please sign in to comment.