You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was working on a code example to show how the fill keyword argument on add_grid doesn't do anything (which it doesn't), but I couldn't even get an example to work without it being obvious why it didn't work. Let me explain:
fill is actually not used anywhere from add_grid as far as I can tell.
This code makes very little sense as we just checked if font is None and then we use it. For the AGG writer this is expected to be the path to the font file...but if we provide a font file path then it doesn't get used because we only create the font object if it is None!?!? 😕
So then you, the user, think "oh I'll just provide a font object", well at that point you aren't using the font size or the fill because aggdraw Fonts have to have the color defined when they are created.
@lobsiger I'm going to think about this a little more before closing. I think the code is still confusing and if things are rearranged (ex. not creating a default font inside a low-level method) things would be more clear. I will do this as part of my larger refactoring.
I was working on a code example to show how the
fill
keyword argument onadd_grid
doesn't do anything (which it doesn't), but I couldn't even get an example to work without it being obvious why it didn't work. Let me explain:fill
is actually not used anywhere fromadd_grid
as far as I can tell.font
isNone
it fails:pycoast/pycoast/cw_base.py
Lines 121 to 123 in c9584be
This code makes very little sense as we just checked if font is None and then we use it. For the AGG writer this is expected to be the path to the font file...but if we provide a font file path then it doesn't get used because we only create the font object if it is
None
!?!? 😕So then you, the user, think "oh I'll just provide a font object", well at that point you aren't using the font size or the
fill
because aggdraw Fonts have to have the color defined when they are created.So...this needs to be improved. This is confusing to say the least.
The text was updated successfully, but these errors were encountered: