How do I use TextAlignment in TextEntity?
Maintainers usually reply within 3 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 25/100
Research direction
The issue does not name a file or test. Start by locating TextEntity and reading how its alignment properties are used when writing or rendering text; then check any existing tests for text alignment. Done means identifying why the shown alignment setup does not work and confirming the behavior with a focused test.
Written by the indexing model from the issue text.
Description
This is my code for the text alignment but is doesn't work.
Could you help me figure out what's wrong?
TextEntity textEntity = new TextEntity();
textEntity.Height = height;
textEntity.Rotation = rotation * Math.PI / 180.0;
textEntity.Value = text;
textEntity.AlignmentPoint = position ;
textEntity.InsertPoint = position ;
textEntity.Normal = CSMath.XYX.AxisY;
switch (hAlign)
{
case TextRender.HorzAlign.Left: textEntity.HorizontalAlignment = ACadSharp.Entities.TextHorizontalAlignment.Left; break;
case TextRender.HorzAlign.Right: textEntity.HorizontalAlignment = ACadSharp.Entities.TextHorizontalAlignment.Right; break;
case TextRender.HorzAlign.Center: textEntity.HorizontalAlignment = ACadSharp.Entities.TextHorizontalAlignment.Center; break;
default:
textEntity.HorizontalAlignment = ACadSharp.Entities.TextHorizontalAlignment.Left; break;
}
switch (vAlign)
{
case TextRender.VertAlign.Top: textEntity.VerticalAlignment = ACadSharp.Entities.TextVerticalAlignmentType.Top; break;
case TextRender.VertAlign.Bottom: textEntity.VerticalAlignment = ACadSharp.Entities.TextVerticalAlignmentType.Bottom; break;
case TextRender.VertAlign.Center: textEntity.VerticalAlignment = ACadSharp.Entities.TextVerticalAlignmentType.Middle; break;
default:
textEntity.VerticalAlignment = ACadSharp.Entities.TextVerticalAlignmentType.Baseline; break;
}
btr.Entities.Add(textEntity);
- Dominant language
- C#
- Stars
- 873
- Forks
- 223
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 28
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from DomCR/ACadSharp
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 3 days
-
DWG writer: text styles get the text-style table as their xref block handlePossibly taken @menes97 claimed this 4 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 81/100
Maintainers usually reply within 3 days
-
Difficulty 1/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 3 days
-
DwgWriter writes a null shape-file handle for SHAPE entities (WriteShapes = true)Possibly taken @menes97 claimed this 4 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 3 days
-
DwgReader reads a color-book entity's Color as ByBlock instead of the book's colorPossibly taken @menes97 claimed this 4 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 3 days
Similar issues
-
hand-to-AI
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
CactuseSecurity/firewall-orchestrator#5803 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
bug python
Difficulty 1/5 Under an hour Newbie friendliness 88/100
ilia-sokolov/OfficeAgent.NET#89 ·
Maintainers usually reply within 13 days