ILXL / ILXL/cpputils

Text object

Open
#9 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
4
Forks
1
PR merge metrics
No merged PRs in 30d

Description

Design a Text object that allows you to set its size, color, and value. Its most important feature is to retrieve the text width and height so that developers can check whether they fit in a given region. For example, the feature allows you to check whether the text could fit inside a box of a given height and width.

A possible solution would be to create an image object, drawtext on it, then retrieve the objects resulting width and height as described [here](https://stackoverflow.com/questions/24190327/getting-the-dimensions-of-a-rendered-text-in-cimg-library). The suggested code is shown below for reference:

```cpp
CImg imgtext;
unsigned char color = 1;
imgtext.draw_text(0,0,"Hello guys !",&color,0,1,23); // Draw with font height 23.
// Now, imgtext.width() and imgtext.height() gives you the dimensions you want.
```

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Begin with the linked CImg draw_text example and determine how a Text object should expose size, color, value, and rendered dimensions. Done means developers can set those properties and retrieve width and height to check whether text fits a specified region.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-graphics
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.