MeshLib
 
Loading...
Searching...
No Matches
MRSymbolMesh.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRSymbolMeshFwd.h"
4
5#include "MRMesh/MRVector2.h"
6#include "MRMesh/MRSystem.h"
7#include "MRMesh/MRExpected.h"
8
9#include <string>
10#include <filesystem>
11
12namespace MR
13{
14
20
22{
23 // Text that will be made mesh
24 std::string text;
25 // Detailization of Bezier curves on font glyphs
27 // Additional offset between symbols
28 // X: In symbol size: 1.0f adds one "space", 0.5 adds half "space".
29 // Y: In symbol size: 1.0f adds one base height, 0.5 adds half base height
30 Vector2f symbolsDistanceAdditionalOffset{ 0.0f, 0.0f };
31 // Symbols thickness will be modified by this value (newThickness = modifier*baseSymbolHeight + defaultThickness)
32 // note: changing this to non-zero values cause costly calculations
34 // alignment of the text inside bbox
36#ifdef _WIN32
37 // Path to font file
38 std::filesystem::path pathToFontFile = GetWindowsInstallDirectory() / "Fonts" / "Consola.ttf";
39#else
40 // Path to font file
41 std::filesystem::path pathToFontFile;
42#endif // _WIN32
43
44 // max font size with 128 << 6 FT_F26Dot6 font size
45 static constexpr float MaxGeneratedFontHeight = 5826.0f * 1e-3f;
46};
47
48// converts text string into set of contours
50
51// given a planar mesh with boundary on input located in plane XY, packs and extends it along Z on zOffset to make a volumetric closed mesh
52// zOffset should be > 0
53MRSYMBOLMESH_API void addBaseToPlanarMesh( Mesh& mesh, float zOffset = 1.0f );
54
55// converts text string into Z-facing symbol mesh
57
58}
#define MRSYMBOLMESH_API
Definition MRSymbolMeshFwd.h:11
Definition MRCameraOrientationPlugin.h:7
MRSYMBOLMESH_API Expected< Mesh > createSymbolsMesh(const SymbolMeshParams &params)
tl::expected< T, E > Expected
Definition MRExpected.h:49
AlignType
Definition MRSymbolMesh.h:15
@ Right
Definition MRSymbolMesh.h:18
@ Center
Definition MRSymbolMesh.h:17
@ Left
Definition MRSymbolMesh.h:16
MRSYMBOLMESH_API Expected< Contours2d > createSymbolContours(const SymbolMeshParams &params)
MRSYMBOLMESH_API void addBaseToPlanarMesh(Mesh &mesh, float zOffset=1.0f)
Definition MRMesh/MRMesh.h:23
Definition MRSymbolMesh.h:22
static constexpr float MaxGeneratedFontHeight
Definition MRSymbolMesh.h:45
Vector2f symbolsDistanceAdditionalOffset
Definition MRSymbolMesh.h:30
float symbolsThicknessOffsetModifier
Definition MRSymbolMesh.h:33
int fontDetalization
Definition MRSymbolMesh.h:26
std::filesystem::path pathToFontFile
Definition MRSymbolMesh.h:41
std::string text
Definition MRSymbolMesh.h:24
AlignType align
Definition MRSymbolMesh.h:35