Javascript: String width in pixels

     

One of the hardest things about doing web development - using the browser as your GUI - is that you have to get used to, and accept, “close enough” (actually, getting your clients used to that idea is probably harder). “Close enough” is in direct conflict with many things in computer science, so it’s a difficult pill to swallow.

Keeping that in mind…

I was chatting with one of my friends, and they asked if there was anyway to get the length of a string in pixels. He needed it mostly for form layouts - to align buttons with labels. The project I am working on I have a similar issue, but not related to buttons (more of a dynamic truncation “…” kind of thing).


PIC Programming on OS X

     

Finally! I’ve been trying to setup some kind - any kind - of PIC programming environment on my OS X box. Most of them come with Windows applications and there are a few Linux tools out there, but I wanted an OS X environment.

I didn’t get a pure one however. I did have to use Apple’s X11 and most of the tools are Linux based, but I can now compile and write code to a chip. Since I am just starting out I am not too picky on what kind of chips I can write to, I just needed something to get me started. So if you are in the same boat here are some somewhat detailed steps to getting setup.


     

I’ve been wanting to get back into - blogging, journaling, whatever - for a while now, but I have been hesitant.

I’d like to know that, perhaps, someone has gotten some benefit out of my crazy ramblings, but I also don’t want to self aggrandize. I want it to be anonymous, but then I kind of don’t.

Phloging down here in this gopher hole seems to be the perfect solution. No one cares, yet there are a few people who do. It has a slight technical barrier to entry, so those who would make it this far, have a real desire.


     

λx.x

Software Engineer interested in graphics, 3d game engines, hardware hacking, and all things +/-5v


WebXR Engine: https://meshengine.xyz/ YouTube: https://www.youtube.com/robrohan

HTML Site: https://robrohan.com LinkedIn: https://www.linkedin.com/in/robrohan GitLab: https://gitlab.com/robrohan GitHub: https://github.com/robrohan