Navigation

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Users
    • Groups
    • Solved
    • Unsolved
    • Search
    1. Home
    2. snaders
    3. Posts
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    Posts made by snaders

    • RE: Possible fix for kerning with two different fontvariations(wght) for neighbouring letters??

      I get what you are saying. I also don't know what the kerning should be, but now it just jumps to a really wide setting the moment 2 letters next to each other have different weights. Also if it's just a difference of 1 (so no black and light).
      It's not changing over time, it's just 'normal' or 'wide', nothing in between. I only get this in Drawbot for now, can't replicate it in Sketch or Illustrator.

      Anyway, happy I got a workaround now 🙂

      posted in General Discussion
      snaders
      snaders
    • RE: Possible fix for kerning with two different fontvariations(wght) for neighbouring letters??

      Thanks Frederik.

      The weird thing is that I can't replicate this issue it in Sketch for example. If I type 2 letters in that font, and select one and change the weight, the kerning does not jump. In Illustrator the kerning also seemed off, unless you use optical kerning.

      Also, we spoke to the type foundry who made the font, and they said their programmer made the same kind of animation using CSS and JS, and they didn't have this issue. But I didn't get the change to verify this.

      Anyway, the cheat with adding a small number seems to do the trick. I wrote a little function, which checks the text beforehand and applies custom minus kerning to know pairs. The designers who are going to work with this code can easily use this same function to overwrite values they don't like. Works for now.

      Also, we have a plugin for After Effect that does the same kind of animation, and also doesn't do the kerning jump (could be using optical kerning). But the plugin has some other flaws, and is not user friendly, hence we built our own code to create the typographic animations we need 🙂

      Thanks again for your time and thinking with me 🙂

      posted in General Discussion
      snaders
      snaders
    • RE: Possible fix for kerning with two different fontvariations(wght) for neighbouring letters??

      So I 'fixed' it for now by always adding a small number to every letters weight, to they are never the same. This gives me the 'wrong' kerning for the kerning pairs, but then I change the kerning by hand for those letter combinations. Not a nice solution, but workable for now.

      Still would like to have a better way of doing this.

      posted in General Discussion
      snaders
      snaders
    • RE: Possible fix for kerning with two different fontvariations(wght) for neighbouring letters??

      Screenshot 2021-01-23 at 19.46.21.png
      Here the Y and O both have weight 335

      Screenshot 2021-01-23 at 19.46.33.png
      Here the Y has 335, the O has 336.

      posted in General Discussion
      snaders
      snaders
    • Possible fix for kerning with two different fontvariations(wght) for neighbouring letters??

      Hope I can explain this correctly:

      I'm drawing letters next to each other, and they all get their own fontVariatons(wght). But the MOMENT two letters next to each other have different weights, the kerning jumps. This only happens for kerning pairs like YO and TA, not for other letters. I get a perfect animation if I change the O for an X for example.

      I want to make a kind of animation where the letters get bolder in a wave form. I get this to work, but the first time two letters next to each other are different, the kerning jumps. It stays like this until the moment the two letters are the same again in weight.

      I tested a couple of variable fonts and it happens in all of them, although in some it's a lot less noticeable.

      I use append to add a letter to a formattedString and draw it in a bezierPath, or a textBox. Same results. I also tried setting the tracking to 0.

      Any suggestions would be MUCH appreciated! Really stuck on this one...

      posted in General Discussion
      snaders
      snaders
    • RE: Get location of added letter to FormattedString

      Looking at your code, it should be doable by maybe changing the fill for every letter, right? That makes every letter an independant textBox.

      I only use it virtually in the beginning to get the position, I don't actually draw the letters then anyway, so the fill won't influence the end result. Will try to do this, thanks again!

      posted in General Discussion
      snaders
      snaders
    • RE: Get location of added letter to FormattedString

      Hey @frederik, always happy when you reply because you seem to be right all the time haha.

      It sounds like textBoxCharacterBounds is about what I was looking for, but I want to do the following:

      I have a word or sentence and put it in a font, align it center and now I want to have the actual x, y position of every letter on the screen. From your code it looks like it should be possible with textBoxCharacterBounds, but I want it separately for every letter.

      Because later on I use these positions to check PNG's I load every frame to determine what the weight of every letter should be. That last part is working, but now I put the location of every letter by hand. But I of course want to automatically get the position of every letter in a string because it will be variabel. Does that makes sense?

      posted in General Discussion
      snaders
      snaders
    • Get location of added letter to FormattedString

      I'm adding letters to a FormattedString one by one (with append), but I want to save the position of each letter when I do that. Is something like this possible, and how would I go about it?

      It doesn't even have to be a FormattedString per se. I could also just type the text beforehand (because it is always centered), and then get the position of each letter.

      Thanks in advance!

      posted in General Discussion
      snaders
      snaders
    • RE: Reading pixel values (rgb or brightness) on coordinations

      Thanks @gferreira, I somehow completely missed that when going through the documentation. That's exactly what I need haha. I only have to go through through a single line of pixels, so hopefully the speed won't matter that much.

      posted in General Discussion
      snaders
      snaders
    • Reading pixel values (rgb or brightness) on coordinations

      Hello all,

      Something I do a lot of times in Processing is load an image or video and read the pixel values at specific coordinates to use as values for an animation. It this something that can be done in Drawbot?

      It can probably be done in Python with the image library, but I have no further experience with coding in Python.

      In short I want to control the weight of a letter on a specific location based on a separate black and white images input (black is 0, white is 100%). Any ideas?

      posted in General Discussion
      snaders
      snaders
    • RE: Import python file.

      @gferreira said in Import python file.:

      but unless you are importing code

      Clear. I will look into JSON then. I only load some settings for size and speed and such. Thanks again.

      posted in General Discussion
      snaders
      snaders
    • RE: Import python file.

      @gferreira Ah nice, that works.

      Just have 2 questions/wishes left. Tried googling, but these things look so confusing to me...

      I know have this:

      from importlib import reload
      
      import settings_new
      reload(settings_new)
      from settings_new import *
      

      Which works. Ideally I would let people set a variable (in this case) called settings_new at the beginning of the code and fill the import things in automatically. So they don't have to change this on 3 places.
      I could get the import and reload to work with a variable as the module-name, but not the from ... import * part. Can I do this?

      Also, can the module be in another folder? It's a subfolder of the root where the code is in. So not a complete other location.

      Thanks again!

      posted in General Discussion
      snaders
      snaders
    • RE: Import python file.

      @gferreira Thanks for your quick reply. I actually was trying something like that, but couldn't get the variables out.

      It's working now, but I have to restart Drawbot everytime I want to load new settings. I can't just resave the settings file and rerun the script, it'll use the old variables.

      I think it sounds best to load something from an external JSON file. I will look into that.
      Basically I want the designers who use my code to keep a folder of different settings they can use for different outcomes. Now they save multiple versions of the code...

      posted in General Discussion
      snaders
      snaders
    • Import python file.

      Hello,

      Is it possible to load a python file in another file in Drawbot? Have been googling for pure python solutions, but I can't get it to work.

      Basically what I want:
      I have my main python code which I run to generate a movie. I want to load the 'settings' (just a bunch of variables I set in the beginning of the code) from another file. This way I can update the code and have the designer save different sets of settings and load these. What would be the way to go about this?

      I tried something like settings a function in the settings.py file and import that, but no luck.

      posted in General Discussion
      snaders
      snaders
    • RE: Using global variables input

      Hello @gferreira,

      Thanks for the quick reply. I mistakenly thought vanilla just ment that it didn't have any 'addons'. Like vanilla JS...

      This makes a lot more sense, will look into that! Thanks a lot!

      posted in General Discussion
      snaders
      snaders
    • Using global variables input

      Hi all,

      I'm looking for a way to create a simple interactive Drawbot script, where users can fill in a couple of text fields, run the code, and end up with a movie.

      I can find something about the Variables in the documentation, but I'm not sure how to go from there.

      Basically, I have 3 questions:

      1. Is there something like a 'button' UI element? Something that can trigger something for example?
      2. Is there more documentation on this, like is this a Drawbot specific thing, or is it embedded in Python?
      3. Are there better ways to create a simple UI for a Drawbot-script? Like making the thing in Python and loading Drawbot as a module etc?

      I understand these are quite 'broad questions', but I'm just looking to get pointed in a general direction.

      Thanks!

      posted in General Discussion
      snaders
      snaders
    • RE: Add fontVariation to text drawn in bezierPath?

      Hey guys,

      Has been a while since the last post, but just wanted to thank you guys again for the help. It all worked out great and the project is live (can I post this here?): https://www.instagram.com/p/Bsx6AhVhlNf/ Thought you guys might enjoy this!

      posted in General Discussion
      snaders
      snaders
    • Drawbot freezes after running

      I know the title is kinda vague, I can provide more info if needed of course:

      I have a script that runs and creates frames with text and saves it as a mp4. Right after running (takes a couple of seconds) Drawbot freezes. Have to Force Quit it. It DOES complete the whole script since it saves a perfectly good MP4. Any way to make sure this doesn't happen? Can I save a MP4 without displaying the pages for example?

      With less frames (about 50) it also freezes for a while, but will unfreeze after showing all the pages. with 250 frames it just freezes and stays that way.

      Update: it does the same thing when not saving as a MP4. It just runs, goes through all the frames, and then takes a long time displaying the pages. Is there a better way to do this?

      posted in Bugs
      snaders
      snaders
    • RE: Add fontVariation to text drawn in bezierPath?

      I tried this (B is the bezierPath).
      This doesn't work:

      fontVariations(wdth = self.vw)
      self.B.text("E", (0, 0), fontSize=100, font='Variabletest-Thin')
      

      Is there another syntax I should be using? I don't get any errors btw.

      posted in General Discussion
      snaders
      snaders
    • Add fontVariation to text drawn in bezierPath?

      This is kind of a follow-up question to another forumpost of mine.

      I have a bezierPath where I draw a letter. After that I scale this shape to a certain size. I just can't find a way to draw the letter with using fontVariations.
      (I know how to use fontVariations when I just draw text outside of a bezierPath. So the font is working.)

      Any ideas on how I can do this?

      posted in General Discussion
      snaders
      snaders