Navigation

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

    Posts made by frederik

    • RE: Can I use use areaAverage() to analyze an actual image?

      thanks @monomonnik that is correct

      posted in General Discussion
      frederik
      frederik
    • RE: mp4 with transparent background?

      mmm see https://github.com/typemytype/drawbot/issues/391

      open an issue to discus it further 🙂

      thanks

      posted in Feature Requests
      frederik
      frederik
    • RE: Auto-Resize FormattedString

      why trying to find the pointSize? just scale everything with textWidth/boxWidth

      posted in General Discussion
      frederik
      frederik
    • RE: Drawbot Preferences

      you can not copy that file while the app is open, that pref file is always written when the app closes and will not sync when you adjust it

      posted in General Discussion
      frederik
      frederik
    • RE: Run drawbot.app as viewer only

      DrawBot has not such a feature... however you can install DrawBot as a module and use it externally building the pdf and previewing it elsewhere

      let use know if you find a solution!

      posted in General Discussion
      frederik
      frederik
    • RE: trim box in pdfs

      tried it a long time ago... didnt got it to work for some reason, so support for trim and bleed is set on hold:

      https://github.com/typemytype/drawbot/pull/304

      if you got any idea to get it to work with quartz pdf context, let me know 🙂

      posted in Feature Requests
      frederik
      frederik
    • RE: QRCodeGenerator(size, message)

      hehe, totally forgot about that one... but I prefer the solution with pyqrcode as it provides a list 0/1

      posted in General Discussion
      frederik
      frederik
    • RE: QRCodeGenerator(size, message)

      in the pip installer: pyqrcode --no-deps

      import pyqrcode
      
      blockSize = 10
      
      qr = pyqrcode.create('http://www.drawbot.com/')
      
      for x, row in enumerate(qr.code):
          for y, bit in enumerate(row):
              if bit:
                  rect(x * blockSize, y * blockSize, blockSize, blockSize)
              
      print(qr.code)
      
      posted in General Discussion
      frederik
      frederik
    • RE: QRCodeGenerator(size, message)

      no idea... but the image is indeed blurry. A quick search for CoreImage filter CIQRCodeGenerator + blurry results in lots of options but none of them apply to DrawBot.

      I would look at some python packages like https://github.com/mnooner256/pyqrcode to build the QR data and draw it with DrawBot, without round tripping to a png or image

      good luck!

      posted in General Discussion
      frederik
      frederik
    • RE: when to apply paragraphBottomSpacing

      I guess this is a coreText thing. When composing the same text with hard returns and soft returns (shift + enter) in TextEdit, there is no difference between soft and hard returns.

      97bc7514-5ad3-49a9-a954-a2362b5dd714-image.png

      I guess you'll need to script it and change the the bottom spacing for text-runs with soft returns.

      posted in Feature Requests
      frederik
      frederik
    • RE: listNamedInstances is broken ?

      thanks for the issue

      --> https://github.com/typemytype/drawbot/issues/495

      posted in General Discussion
      frederik
      frederik
    • RE: listNamedInstances is broken ?

      can you provide the not working google fonts?

      and if this is persisting, it would be handy to open an issue in the drawBot repo.

      thanks!

      posted in General Discussion
      frederik
      frederik
    • RE: Running Drawbot as a module in environments that aren't Mac OS X

      DrawBot is mac only... that will not change fast as we got now a super high level of typographic support...

      However Just started drawBotSkia which has a subset of the DrawBot api but uses skia as backend.

      see https://github.com/justvanrossum/drawbot-skia

      posted in Bugs
      frederik
      frederik
    • RE: Mute DrawBot warning ?

      you can always ignore all warnings with:

      import warnings
      warnings.simplefilter("ignore")
      

      see https://docs.python.org/3.7/library/warnings.html

      posted in General Discussion
      frederik
      frederik
    • RE: Mute DrawBot warning ?

      which warning?

      posted in General Discussion
      frederik
      frederik
    • RE: BezierPath offset problem.

      the mistake here is that bounds are not structured as x, y, width, height as required for rect(...)but as minx, miny, maxx, maxy.

      minx, miny, maxx, maxy = path.bounds()
      rect(minx, miny, maxx-minx, maxy-miny)
      
      posted in General Discussion
      frederik
      frederik
    • RE: Python Update ?

      no, you can not.. but DrawBot exists also as a module where you can use your own python.

      see https://github.com/typemytype/drawbot#using-drawbot-as-a-python-module

      posted in General Discussion
      frederik
      frederik
    • RE: Beginner Question

      its all the same and very much based on coding flavours

      different approach, similar result, here you know the amount of lines exactly.

      import random
      
      size(600, 849)
      
      margin = 106
      density = [3,2,7,20, 1002] # the amount of lines
      rows = len(density)
      row_width = width() - 2 * margin
      row_height = (height() - 2 * margin) / rows
      
      fill(None)
      strokeWidth(1)
      stroke(0)
      
      for i, d in enumerate(density):
          y1 = margin + i * row_height
          y2 = y1 + row_height
          x_positions = [random.random() * row_width for _ in range(d)]
          for x in x_positions:
              line((x, y1),(x, y2))
      
      posted in General Discussion
      frederik
      frederik
    • RE: Beginner Question

      thanks @monomonnik! very well explained!

      the while loop at the end makes its maybe a bit unreadable...

      you can use random.sample to generate a random list easily:

      import random
      
      density = 5
      result = random.sample(range(0, 100), density)
      print(result)
      
      posted in General Discussion
      frederik
      frederik
    • RE: Rewind rect() x position for endless movement

      I guess you made it to difficult...

      
      Variable([
          dict(name="progress", ui="Slider",
                  args=dict(
                      value=0,
                      minValue=0,
                      maxValue=1,
                      )),
          ], globals())
          
      backgroundColors = [
          (0.5, 1, 0.5), 
          (0.5, 1, 1), 
          (0.5, 0, 0), 
          (1, 1, 0), 
          (0.5, 0, 1), 
          (0.5, 0.5, 0.5), 
          (0, 1, 0)
      ]
      
      # pageW, pageH = (500, 500)
      pageW, pageH = width(), height()
      
      
      advance = pageW * progress
      
      itemCount = len(backgroundColors)
      itemWidth = pageW / (itemCount)
      
      moveIndex = int(advance * progress // itemWidth)
      backgroundColors = backgroundColors[-moveIndex:] + backgroundColors
      
      for i in range(0, itemCount + 1):
          color = backgroundColors[i]
          fill(*color)    
          rect(itemWidth * (i-moveIndex) - itemWidth + advance * progress, 0, itemWidth, pageH)
      
      fill(None)
      stroke(0)
      strokeWidth(10)
      rect(0, 0, pageW, pageH)
      
      
      posted in General Discussion
      frederik
      frederik