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

Right edge of text is cut off for some words #60

Open
lucsmall-ei opened this issue Apr 30, 2018 · 3 comments
Open

Right edge of text is cut off for some words #60

lucsmall-ei opened this issue Apr 30, 2018 · 3 comments

Comments

@lucsmall-ei
Copy link

When generating word clouds, we are noticing that for some words the right hand edge is cut off.

image

This doesn't happen to all the words - roughly 50% appear perfectly:

image

And it can happen even when there is plenty of whitespace around the word:

image

Have you seen this issue before and do you have any views on the cause?

Below are some more details:

  • the word cloud renders perfectly in our dev environment (MacOS 10.13)
  • we are only seeing this clipping issue in our test environment (Elastic Beanstalk Java).

We are using the built in San Serif font:

private static final KumoFont WORD_CLOUD_KUMO_FONT = new KumoFont(new Font(Font.SANS_SERIF, Font.PLAIN, 12));

We are setting up the word cloud as follows:

  final Dimension dimension = new Dimension(imageSize, imageSize);
     final WordCloud wordCloud = new WordCloud(dimension, CollisionMode.RECTANGLE);
     wordCloud.setPadding(0);
     wordCloud.setBackground(new CircleBackground(imageSize / 2));
     wordCloud.setBackgroundColor(Color.WHITE);
     wordCloud.setColorPalette(new ColorPalette(style.getWordCloudColours()));
     wordCloud.setFontScalar(new SqrtFontScalar(1, 40));
     wordCloud.setAngleGenerator(new AngleGenerator(0));
     wordCloud.setWordPlacer(new RTreeWordPlacer());
     wordCloud.setKumoFont(WORD_CLOUD_KUMO_FONT);

Any thoughts on the cause would be received with gratitude and happy to provide further details as needed.

@kennycason
Copy link
Owner

kennycason commented Apr 30, 2018

Oh interesting. I have not noticed this. I may be calculating width poorly somewhere. Thanks for posting an example. I have not seen this previously.

@unitron
Copy link

unitron commented Nov 1, 2018

I have almost the same issue (upper/lower edge of text is cut off for some words) in v1.5. Have you fixed it in the latest version?

@gabrielapinto
Copy link

Hello! Any solution for this problem? I am facing the same problem with cut off words. I would appreciate any help!

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

4 participants