Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text rendering #7

Merged
merged 96 commits into from
Nov 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
51e0e6f
Initial structures for FontAsset and Text rendering
nieznanysprawiciel Oct 26, 2024
e7de1f5
Add FreeType dependency
nieznanysprawiciel Oct 26, 2024
1d38205
Create test for FontAsset loader to check linker
nieznanysprawiciel Oct 26, 2024
a45a4bc
Loading glyphs and kerning using FreeType library
nieznanysprawiciel Oct 26, 2024
09d4c1a
Test FontLoader Glyphs and kerning generation
nieznanysprawiciel Oct 27, 2024
e425769
Test FontLoader for ttf and otf format
nieznanysprawiciel Oct 27, 2024
8b4b43f
Render Atlas skeleton
nieznanysprawiciel Oct 31, 2024
8e7f36e
Implement Path::ChnageExtension; SOIL image saving function
nieznanysprawiciel Oct 31, 2024
503c520
Introduce Image and ImageRegion structs
nieznanysprawiciel Nov 1, 2024
3192529
Font Atlas rendering works
nieznanysprawiciel Nov 1, 2024
b051db9
Remove leftovers from freetype examples
nieznanysprawiciel Nov 1, 2024
a15f726
Improve tests (check atlas and some glyphs)
nieznanysprawiciel Nov 1, 2024
6338a8b
Test - Validate intersections between Glyphs
nieznanysprawiciel Nov 1, 2024
f5fd52b
Support loading multiple Font sizes
nieznanysprawiciel Nov 1, 2024
6aed855
Disable saving atlas; Move things around
nieznanysprawiciel Nov 1, 2024
f7a6339
Fix compliation
nieznanysprawiciel Nov 1, 2024
b7f8c12
Encode default character set as UTF-8
nieznanysprawiciel Nov 2, 2024
10fff1e
Incldue more in precompiled header
nieznanysprawiciel Nov 2, 2024
c44b588
Fix characters encoding in test
nieznanysprawiciel Nov 2, 2024
27d6e24
Layout first not tested attempt
nieznanysprawiciel Nov 2, 2024
310f1dd
Text geometry generation first attempt (not working)
nieznanysprawiciel Nov 7, 2024
ed0e522
Basic generation: test passes
nieznanysprawiciel Nov 7, 2024
0c0e530
Test newlines and spaces
nieznanysprawiciel Nov 7, 2024
131466e
Test arranger passes
nieznanysprawiciel Nov 8, 2024
b1fe033
Add additional multiline tests
nieznanysprawiciel Nov 8, 2024
b4f5efc
Whitespaces only
nieznanysprawiciel Nov 8, 2024
cc51acb
Fix PlanarUV generation crash
nieznanysprawiciel Nov 9, 2024
be01838
Move forward TextBlock implementation (not finished)
nieznanysprawiciel Nov 9, 2024
f4f9d1c
Implement ConsoleLogger; simple logging macros
nieznanysprawiciel Nov 9, 2024
d3ed926
Fix compilation of mocks
nieznanysprawiciel Nov 10, 2024
d831110
Fix FontLoader to handle case when Atlas arleady exists
nieznanysprawiciel Nov 10, 2024
11440c6
Fix FontLoader: attempting to load font for the second time with the …
nieznanysprawiciel Nov 10, 2024
e8546b7
TextBlock is able to load font (work in progress - shaders don't work)
nieznanysprawiciel Nov 10, 2024
569ab6d
Add opacity shaders for text; 2 Textures can be bound to pipeline at …
nieznanysprawiciel Nov 10, 2024
224b644
Dispaly correctly text background
nieznanysprawiciel Nov 10, 2024
f3962c3
Add MapErr to ReturnResult
nieznanysprawiciel Nov 10, 2024
ff06c58
MapErr for Nullable
nieznanysprawiciel Nov 10, 2024
2bc6c5d
Drawing has ability to return errors instead of silently ignoring them
nieznanysprawiciel Nov 10, 2024
00740bc
Reproduce bug with failure when creating Input Layout having 2x texco…
nieznanysprawiciel Nov 10, 2024
ba8b8d5
Use precompiled header in TestResources.DX11
nieznanysprawiciel Nov 10, 2024
e6f04a3
Fix problem with creating Layout with duplicated attributes semantics
nieznanysprawiciel Nov 11, 2024
af9a008
Fix Layout tests in GUI
nieznanysprawiciel Nov 11, 2024
a1c04c0
Add PerformanceCheck; Console and file output; Bind F1 and F2 to Host…
nieznanysprawiciel Nov 11, 2024
e05f60d
Fix problem with TextGeometry exceeding resonable buffer size
nieznanysprawiciel Nov 11, 2024
acfc6b6
Add colors definition from WPF
nieznanysprawiciel Nov 11, 2024
f4365bf
Test text arrangment; Fix offset from top
nieznanysprawiciel Nov 11, 2024
b7b7927
First working text rendering
nieznanysprawiciel Nov 11, 2024
d06b519
Implement ColorExt; Render full text to check arrangment
nieznanysprawiciel Nov 12, 2024
afb89c2
Allow returning error from Geometry::Generate; Fix Nullable::MapErr f…
nieznanysprawiciel Nov 12, 2024
d70ffe0
Text rendered with background
nieznanysprawiciel Nov 12, 2024
f7b2f32
Text playground project
nieznanysprawiciel Nov 12, 2024
b7166e3
TextShowcase - examples with different alignment and brushes
nieznanysprawiciel Nov 12, 2024
f875d25
Fix justification broken due to line width mis-computation
nieznanysprawiciel Nov 13, 2024
825a0bf
Fix FakeGeometry compilation
nieznanysprawiciel Nov 13, 2024
0dabc83
Fix padding on right side when justifying
nieznanysprawiciel Nov 13, 2024
5b5ec5e
Don't justify last line of paragraph or whole text
nieznanysprawiciel Nov 13, 2024
734b0f4
Snap to pixels option in arranger
nieznanysprawiciel Nov 13, 2024
338690f
Fix tests for TextArranger alignment
nieznanysprawiciel Nov 13, 2024
aa594e4
DependencyProperty for TextBlock
nieznanysprawiciel Nov 13, 2024
1f4be22
Add rttr definitions of some enums
nieznanysprawiciel Nov 13, 2024
23d3308
Fix TwoWay binding
nieznanysprawiciel Nov 13, 2024
b0d23b4
Binding Text to time counter
nieznanysprawiciel Nov 13, 2024
ad7573f
Add UpdateData and Resize functions to IBuffer interface and Dx11 api
nieznanysprawiciel Nov 14, 2024
bdca9ee
Updatable TextDrawing
nieznanysprawiciel Nov 14, 2024
0c8a7f7
Fix memory leak when resizing Resources
nieznanysprawiciel Nov 15, 2024
abb070b
Enable vsync for non-blocking mode
nieznanysprawiciel Nov 15, 2024
f35a066
Tests - check Drawing ReturnResults
nieznanysprawiciel Nov 15, 2024
b3c019f
Test compilation of opacity vertex shader
nieznanysprawiciel Nov 15, 2024
40ea6e2
Start with TextControls project
nieznanysprawiciel Nov 15, 2024
0129382
Create FontPicker for finding fonts based on family weight and style
nieznanysprawiciel Nov 15, 2024
ea8be70
Use filesystem::path; List fonts in FontPicker
nieznanysprawiciel Nov 15, 2024
92d6201
Revert Path implementation to custom; change namespace to sw::fs to a…
nieznanysprawiciel Nov 15, 2024
636cf54
Restructure font metadata
nieznanysprawiciel Nov 15, 2024
159321b
Fix ListFonts test
nieznanysprawiciel Nov 16, 2024
b2d4cec
Attampt several fixes
nieznanysprawiciel Nov 16, 2024
821ad3b
Use std::filesystem again and fix failures in tests
nieznanysprawiciel Nov 16, 2024
f8290ae
Remove custom filesystem library
nieznanysprawiciel Nov 16, 2024
878a374
Test FontPicker for incorrect files
nieznanysprawiciel Nov 16, 2024
297fab4
Parsing FontStyle string to extract enums
nieznanysprawiciel Nov 16, 2024
92ec2ed
Font weight and style picker
nieznanysprawiciel Nov 16, 2024
8da9a83
FontAsset keeps metadata
nieznanysprawiciel Nov 16, 2024
d55a84b
Test chosing proper closest Font
nieznanysprawiciel Nov 16, 2024
bd64fe4
Register System font path in GUI; Use FontPicker in TextBlock
nieznanysprawiciel Nov 17, 2024
933265e
FontLoader can choose proper font file; Fix choosing eqivalent FontWe…
nieznanysprawiciel Nov 17, 2024
e2cbadd
Initialize FontPicker in GUI
nieznanysprawiciel Nov 17, 2024
d4d76ba
Fix FreeType memory leak; Reduce memory consumption per text
nieznanysprawiciel Nov 17, 2024
49ed285
Use 8-bits textures for text atlas
nieznanysprawiciel Nov 17, 2024
b48fa01
Use Image for kerning instead of std::map to reduce momory footprint
nieznanysprawiciel Nov 18, 2024
bd15182
TextBox tests in TestControl
nieznanysprawiciel Nov 18, 2024
2cd4dc5
Test TextBlock with different brushes
nieznanysprawiciel Nov 18, 2024
75e3f05
Return errors from shader compilation functions
nieznanysprawiciel Nov 18, 2024
92cd04d
Test brush shaders combinations
nieznanysprawiciel Nov 20, 2024
5b93711
Fix problems with not updating shaders after Drawing recreation (but …
nieznanysprawiciel Nov 21, 2024
253bd18
Use UpdateTraceker/UpdateCounter for Brushes and geometries; Bruses c…
nieznanysprawiciel Nov 23, 2024
6993601
Cache Fonts metadata in FontPicker
nieznanysprawiciel Nov 23, 2024
667dfc9
Fix: Add cached enties to the list of fonts returned
nieznanysprawiciel Nov 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
233 changes: 233 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,233 @@
BasedOnStyle: Microsoft
Language: Cpp
#ColumnLimit: 120

BraceWrapping:
# class definition behind
AfterClass: false
# After the control statement
AfterControlStatement: false
# enum definition behind
AfterEnum: true
# After the function definition
AfterFunction: false
# After the namespace definition
AfterNamespace: false
# ObjC definition behind
AfterObjCDeclaration: false
# struct definition behind
AfterStruct: false
# union definition
AfterUnion: false
#ExternBlock definition behind
AfterExternBlock: false
# before catch
BeforeCatch: false
# else before
BeforeElse: false
# Indented braces
IndentBraces: false
# Split empty function
SplitEmptyFunction: true
# Split empty records
SplitEmptyRecord: true
# Split empty namespace
SplitEmptyNamespace: true

# Add a space after @property, \@property (readonly) instead of \@property(readonly).
ObjCSpaceAfterProperty: true
# Offset of access specifiers (public, private, etc.)
AccessModifierOffset: -4
IndentAccessModifiers: false
# Alignment after opening brackets (opening parentheses, opening angle brackets, opening square brackets): Align, DontAlign, AlwaysBreak (always wrap after opening brackets)
AlignAfterOpenBracket: Align
# When assigning consecutively, align all equal signs
AlignConsecutiveAssignments: false
# When consecutive declarations, align all declared variable names
AlignConsecutiveDeclarations: true
# Left align backslashes that escape newlines (use backslashes for newlines)
AlignEscapedNewlinesLeft: true
# Align the operands of binary and ternary expressions horizontally
AlignOperands: true
# Align consecutive trailing comments
AlignTrailingComments: true
# Allow all parameters of the function declaration to be placed on the next line
AllowAllParametersOfDeclarationOnNextLine: true
# Allow short blocks on the same line
AllowShortBlocksOnASingleLine: false
# Allow short case labels on the same line
AllowShortCaseLabelsOnASingleLine: false
# Allow short functions to be placed on the same line: None, InlineOnly (defined in the class), Empty (empty function), Inline (defined in the class, empty function), All
AllowShortFunctionsOnASingleLine: Inline
# Allow short if statements to stay on the same line
AllowShortIfStatementsOnASingleLine: false
# Allow short loops to stay on the same line
AllowShortLoopsOnASingleLine: false
# Always break after defining the return type (deprecated)
AlwaysBreakAfterDefinitionReturnType: None
# Always wrap after the return type: None, All, TopLevel (top functions, functions not included in the class),
# AllDefinitions (all definitions, excluding declarations), TopLevelDefinitions (the definitions of all top-level functions)
AlwaysBreakAfterReturnType: None
# Always wrap before multi-line string literal
AlwaysBreakBeforeMultilineStrings: false
# Always wrap after the template statement
AlwaysBreakTemplateDeclarations: false
# false means that the function arguments are either on the same line or on their own line
BinPackArguments: true
# false means that all formal parameters are either on the same line or on their own line
BinPackParameters: true
# Braces wrap, only valid when BreakBeforeBraces is set to Custom
# Newline before binary operators: None (newline after the operator), NonAssignment (newline before the non-assignment operator), All (newline before the operator)
BreakBeforeBinaryOperators: NonAssignment
# Wrap a line before the brace: Attach (always attach the brace to the surrounding context), Linux (except for functions, namespaces and class definitions, similar to Attach),
# Mozilla (except enumeration, function, record definition, similar to Attach), Stroustrup (except function definition, catch, else, similar to Attach),
# Allman (always break before the curly brace), GNU (always break before the curly brace, and add extra indentation to the curly brace of the control statement), WebKit (newline before the function), Custom
# Note: It is considered that the statement block also belongs to the function
BreakBeforeBraces: Allman
# Break before ternary operator
BreakBeforeTernaryOperators: true
# Break before the comma in the initialization list of the constructor
BreakConstructorInitializers: BeforeComma
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
EmptyLineAfterAccessModifier: Leave
# Describe the regular expression of the comment with special meaning, it should not be divided into multiple lines or changed in other ways
# CommentPragmas:'^ IWYU pragma:'
# The initialization list of the constructor is either all on the same line or on their own line
AllowAllConstructorInitializersOnNextLine: true
# The indentation width of the initialization list of the constructor
ConstructorInitializerIndentWidth: 4
# The indentation width of the continued line
ContinuationIndentWidth: 4
# Remove the space before the curly braces {after and before the C++11 list initialization
Cpp11BracedListStyle: true
# Inherit the most commonly used pointer and reference alignment
DerivePointerAlignment: false
# Turn off formatting
DisableFormat: false
# Automatically detect whether the function call and definition are formatted as one parameter per line (Experimental)
ExperimentalAutoDetectBinPacking: false
# Fix namespace comment
FixNamespaceComments: true
# Need to be interpreted as a foreach loop instead of a function call macro
# ForEachMacros:
# -foreach
# -Q_FOREACH
# -BOOST_FOREACH
# Sort #include, #include that matches a regular expression has a corresponding priority, and the default priority is INT_MAX (the smaller the priority, the higher the priority),
# You can define a negative priority to ensure that certain #include is always at the top
# IncludeCategories:
# -Regex:'^<ext/.*\.h>'
# Priority: 2
# -Regex:'^<.*\.h>'
# Priority: 1
# -Regex:'^<.*'
# Priority: 2
# -Regex:'.*'
# Priority: 3

# IncludeIsMainRegex:'([-_](test|unittest))?$'
# Indent case label
IndentCaseLabels: true
# Indentation width
IndentWidth: 4
# When the function return type wraps, indent the function declaration or the function name of the function definition
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
# Keep the blank line at the beginning of the block
KeepEmptyLinesAtTheStartOfBlocks: true
# The regular expression of a macro to start a block
# MacroBlockBegin:''
# End the regular expression of a block macro
#MacroBlockEnd:''
# Maximum number of consecutive blank lines
MaxEmptyLinesToKeep: 1
# Namespace indentation: None, Inner (indent the content in the nested namespace), All
NamespaceIndentation: None
# Indent width when using ObjC block
ObjCBlockIndentWidth: 4
# Add a space before ObjC's protocol list
ObjCSpaceBeforeProtocolList: false
# Penalty that wraps the function call after call(
PenaltyBreakBeforeFirstCallParameter: 19
# Introduce a penalty for line breaks in a comment
PenaltyBreakComment: 300
# The penalty for the first line break before <<
PenaltyBreakFirstLessLess: 120
# Introduce a penalty for line breaks in a string literal
PenaltyBreakString: 1000
# Penalty for each character outside the line character limit
PenaltyExcessCharacter: 1000000
# Put the return type of the function in the penalty of its own line
PenaltyReturnTypeOnItsOwnLine: 60
# Alignment of pointer and reference: Left, Right, Middle
PointerAlignment: Left
# RawStringFormats:
# -Language: Cpp
# Delimiters:
# -cc
# -CC
# -cpp
# -Cpp
# -CPP
# -'c++'
# -'C++'
# CanonicalDelimiter:''
# BasedOnStyle: google
# -Language: TextProto
# Delimiters:
# -pb
# -PB
# -proto
# -PROTO
# EnclosingFunctions:
# -EqualsProto
# -EquivToProto
# -PARSE_PARTIAL_TEXT_PROTO
# -PARSE_TEST_PROTO
# -PARSE_TEXT_PROTO
# -ParseTextOrDie
# -ParseTextProtoOrDie
# CanonicalDelimiter:''
# BasedOnStyle: google
# Allow retypesetting comments
ReflowComments: true
# Allow sorting#include
SortIncludes: true
SortUsingDeclarations: true
# Add space after C style type conversion
SpaceAfterCStyleCast: false
# Add a space before the assignment operator
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
# Add a space before opening the parentheses: Never, ControlStatements, Always
SpaceBeforeParens: Never
SpacesInParens: Custom
SpacesInParensOptions:
# ExceptDoubleParentheses: true
InConditionalStatements: true
InEmptyParentheses: false
InCStyleCasts: false
Other: true
# The number of spaces added before trailing comments (only applicable to //)
SpacesBeforeTrailingComments: 2
# Add spaces before and after the angle brackets
SpacesInAngles: Always
# Add spaces in the literal of the container (ObjC and JavaScript arrays and dictionaries, etc.)
SpacesInContainerLiterals: true
# Add spaces in the brackets of C-style type conversion
SpacesInCStyleCastParentheses: false
# Add a space before the (after and) of the parentheses
SpacesInParentheses: false
# Add a space before the [after and] of the square brackets, the declaration of lamda expressions and arrays of unspecified size will not be affected
SpacesInSquareBrackets: true
# Standard: Cpp03, Cpp11, Auto
Standard: Cpp11
# tab width
TabWidth: 4
# Use tab characters: Never, ForIndentation, ForContinuationAndIndentation, Always
UseTab: Never
Loading
Loading