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

Add Bitmap text plugin #1039

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

vmichnowicz
Copy link
Contributor

Bitmap text with support for multiple text styles via HTML tags. Also allow for line breaks and custom color fill.

var text = new Kinetic.BitmapText(),
  img = new Image();

img.src = 'data:image/gif;base64...';

text.setAttrs({
  text: 'normal text<b>BOLD Text</b><br><i>italic text</i>',
  image: img,
  fill: 'blue', // Fill all non-transparent parts of image with this color
  chars: {
    standard: {
      a: [0, 0, 8, 10],
      b: [9, 0, 8, 10],
      c: [17, 0, 6, 10],
    },
    b: {
      a: [0, 12, 10, 10],
      b: [11, 12, 9, 10],
      c: [21, 12, 8, 10],
    },
    i: {
      a: [0, 23, 8, 10],
      b: [8, 23, 8, 10],
      c: [17, 23, 7, 10],
    }
});

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

Successfully merging this pull request may close these issues.

None yet

1 participant