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

How to place longer texts, such as one line longer than 30 characters #86

Closed
LuoJian95 opened this issue Nov 23, 2017 · 5 comments
Closed

Comments

@LuoJian95
Copy link

LuoJian95 commented Nov 23, 2017

@ankush-me
Hi,I meet one problem.
I want to place longer text line, such as one line longer than 30 characters.
However,I can only place text lines that are not more than 15 characters long.
like picture:
4
5
So,what should I do?
I guess that I should make parameter nchar bigger in this line so that the text in this line will longer?
But I don't konw how to make nchar bigger.Or use other methods to place longer text line?
I really need your help.

@LuoJian95
Copy link
Author

I need to place text lines that are longer than 30 characters or even 40 characters.

@LuoJian95 LuoJian95 changed the title How to place longer texts, such as one line longer than 20 characters How to place longer texts, such as one line longer than 30 characters Nov 23, 2017
@ankush-me
Copy link
Owner

ankush-me commented Nov 23, 2017

nchars is computed based on a minimum font-size, and the size of the segment in which the text is being placed. To fit in more characters, you can decrease this minimum size, or select bigger segments / merge multiple segments for placing the text.

@LuoJian95
Copy link
Author

Hi, @ankush-me thank you very much for your reply.
the minimum size you say is self.min_char_height ? I change self.min_char_height from 8 to 2. But it does't generate the longer text line.

Maybe I didn't make my question clear. What I want is shown in the picture below.
n4
The good region has 22 characters.
However, most of other regions only have 10~15 characters.

2017-11-24 17-34-04
My text resources(shown above) have been put on line by line, and the length of each text line is always longer than 30 characters or even 40 characters.
But the longer text line can't place into the image.
I want these longer line also can be placed into the image.

If I get regions where its width is much larger than its height, can I place these long text lines?
for example:
default
I find that the region_1(width >> height) can place longer characters.
Although the area of region_2 is bigger than region_1, it can't place longer characters.

So, How can I get regions like region_1 where its width is bigger than its height ?
How can I place my long text line which is longer than 30 characters into the image?

ALL in all, I just want to place my long text line into the background image.

@ankush-me
Copy link
Owner

You can get rid of segments and place text directly on the image.
You can achieve this by passing in a "fake" segment, as big as the image.

@LuoJian95
Copy link
Author

@ankush-me thank you very much for your reply.
I increase self.min_nchar , which lead to max_font_h decrease, f_h_px decrease, f_h decrease.Finally, nchar increase.
Now, I can place more longer text line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants