QCAD
Open Source 2D CAD
Loading...
Searching...
No Matches
RShxFont.h
Go to the documentation of this file.
1#ifndef RSHXFONT_H
2#define RSHXFONT_H
3
4#include "RFont.h"
5#include <stack>
6
8{
9public:
17 {
18 uint16_t start;
19 uint16_t end;
20 };
21 struct ShxPoint {
22 double x;
23 double y;
24 };
25 struct ShxLine
26 {
27 std::vector<ShxPoint> pts;
28 };
29
30 RShxFont(const QString& fileName);
31
32 virtual bool load() override;
33 bool isEscapeChar(QChar ch);
34protected:
35 QString readLine(FILE* pf);
36 void parseDef(uint16_t ch, char* buf, int len);
37 void parseOneCode(char* &buf, int& len);
38 void parseLenDirByte(uint8_t code);
39 bool caseCode8(char*& buf, int& len);
40 bool caseCodeC(char*& buf, int& len);
41
42 bool calCRFromSEH(double startX, double startY, double endX, double endY, double chordHeight, double& centerX, double& centerY, double& radius);
43 void drawArc(double CenterX, double CenterY, double radius, double startAng, double sweepAng);
44 void drawLine();
45 void startLine();
46 void endLine();
47
48 double scale;
50 QString desc;
52 uint16_t indexCount;
53 uint16_t rangeCount;
54 std::vector<EscapeRange> ranges;
55 std::vector<uint16_t> indexes;
56
57 std::vector<ShxLine> lines;
59
60 double penX;
61 double penY;
62 std::stack<double> penPosition;
64};
65
66
67#endif
Copyright (c) 2011-2018 by Andrew Mustun.
Definition RFont.h:41
bool load()
Loads the font into memory.
Definition RFont.cpp:101
Definition RShxFont.h:8
QString desc
Definition RShxFont.h:50
bool drawMode
Definition RShxFont.h:49
double penX
Definition RShxFont.h:60
std::vector< uint16_t > indexes
Definition RShxFont.h:55
double scale
Definition RShxFont.h:48
uint16_t rangeCount
Definition RShxFont.h:53
Type type
Definition RShxFont.h:51
uint16_t indexCount
Definition RShxFont.h:52
bool containsArcs
Definition RShxFont.h:63
std::stack< double > penPosition
Definition RShxFont.h:62
std::vector< ShxLine > lines
Definition RShxFont.h:57
std::vector< EscapeRange > ranges
Definition RShxFont.h:54
ShxLine curLine
Definition RShxFont.h:58
double penY
Definition RShxFont.h:61
Type
Definition RShxFont.h:10
@ Regfont
Definition RShxFont.h:14
@ Bigfont
Definition RShxFont.h:12
@ Shapes
Definition RShxFont.h:13
@ Unifont
Definition RShxFont.h:11
#define QCADCORE_EXPORT
Definition core_global.h:10
Definition RShxFont.h:17
uint16_t end
Definition RShxFont.h:19
uint16_t start
Definition RShxFont.h:18
Definition RShxFont.h:26
std::vector< ShxPoint > pts
Definition RShxFont.h:27
Definition RShxFont.h:21
double x
Definition RShxFont.h:22
double y
Definition RShxFont.h:23
Definition inftrees.h:24