Import a font using c-sharp

- Posted in Coding by
using System.Runtime.InteropServices;

      //interop to allow import of game font
      [System.Runtime.InteropServices.DllImport("gdi32.dll")]
      private static extern IntPtr AddFontMemResourceEx(IntPtr pbFont, uint cbFont,
          IntPtr pdv, [System.Runtime.InteropServices.In] ref uint pcFonts);

Also before the form's constructor, add a form-level variable (but make sure it comes after the Win32 function import):

Font myFont;

If you have the desired font as a .resx resource in your Visual Studio project, you'll use the following code inside the form's constructor:

//Form1 constructor code that pulls game font into memory
          byte[] fontData = Properties.Resources.brushstr;
          IntPtr fontPtr = System.Runtime.InteropServices.Marshal.AllocCoTaskMem(fontData.Length);
          System.Runtime.InteropServices.Marshal.Copy(fontData, 0, fontPtr, fontData.Length);
          uint dummy = 0;
          fonts.AddMemoryFont(fontPtr, Properties.Resources.brushstr.Length);
          AddFontMemResourceEx(fontPtr, (uint)Properties.Resources.brushstr.Length, IntPtr.Zero, ref dummy);
          System.Runtime.InteropServices.Marshal.FreeCoTaskMem(fontPtr);

          myFont = new Font(fonts.Families[0], 16.0F);

Busy workday

- Posted in Uncategorized by

Busy day at work. I did eleven notes and submitted an OTR. I did two billing correction requests. K skipped out in order to drive out of state to purchase a parrot, supposedly. Our staff meeting, as usual, went about an hour longer than needed. I'm hoping for fewer clients tomorrow. I'm also hoping that a missing client's outing permission form comes in the mail.

I installed TeamViewer14 on my laptop and my ThinkCentre desktop PCs today, the former so that I can access the laptop remotely when at work, the latter so I can access my main desktop at home while on my laptop.

I also backed up my website, my non-public CMS, and some other directories to my MyBook, Seagate drive, and a 1 TB external drive today. Hey, the more backups the better, right?

So, I currently have copies of my blog CMS on: • my laptop • my TNAS • my ThinkCentre desktop PC • my Hewlett Packard PC • my 1 TB external drive • my Seagate external drive • my MyBook external drive • three different thumb drives • my website FTP server • my MyCloud NAS

Bobo and her pals on a trip

- Posted in Uncategorized by

Bobo and her gal pals, taking a trip circa August 2016.

Tweego

- Posted in Coding by

At the time of this writing, I couldn't find a Windows binary release of the Tweego compiler for Twee source code files (Tweego is a program written in Go that can compile Twee source code files into HTML games that can be played in a web browser).

I didn't make a careful record of the perambulating required to obtain a copy of the Tweego executable. It had to be built from source, which I recall involved building it with Node package manager. I managed to accomplish this, however, and installed Tweego.exe at C:MyTweego on my Win10 PC, then added that path to my PATH environment variable.

Sweetness after that.

Sluggish run today

- Posted in Uncategorized by

I waited till about 9:00 am to run this Saturday morning, waited for the humidity to continue dropping from the 95% mark when I woke at 6:15 am. I couldn't delay too long, though, because the temperature was slowly climbing. Started my jog about 9:20 at 85% humidity and 66° F and finished over 90 minutes later at 80% humidity and 73° F.

I must admit, I wasn't feeling it today. I was sluggish (an average pace of 11'18"). Apparently, there were two runs going on in Columbia today, one put on by Lindsey Wilson College and another by the VFW. I saw on FB that one of my running buddy's wife did her first ever 5K today.

Hopefully, this Summer heat will soon break. This whole week it's been in the upper 80s when I get off work, 90-92° with the heat index. Too hot to run in; for me, at least. Today was my first run in a week. I want to get back to 2-3 runs per week. I think that even at 5-7 miles per run, that frequency does my more good.

Since October 2016, I've been using a C# console program I wrote to track my daily caloric intake versus output and track the most recent ten days' average caloric deficit. I plan on writing a post about it, demonstrating how to use it. And I'll probably make the source code available in case anyone wants to improve it. Obviously, a GUI version would appeal to more people, but at the time I wrote it I was looking to get something functional ASAP as well as gain experience CLI programming using the Microsoft C# compiler, csc.exe. I used Notepad++ as my editor.

Aug 07, 2019

- Posted in Uncategorized by

I must admit, I wasn't feeling it today. I was sluggish (an average pace of 11'18"). Apparently, there were two runs going on in Columbia today, one put on by Lindsey Wilson College and another by the VFW. I saw on FB that one of my running buddy's wife did her first ever 5K today.

Hopefully, this Summer heat will soon break. This whole week it's been in the upper 80s when I get off work, 90-92° with the heat index. Too hot to run in; for me, at least. Today was my first run in a week. I want to get back to 2-3 runs per week. I think that even at 5-7 miles per run, that frequency does my more good.

Since October 2016, I've been using a C# console program I wrote to track my daily caloric intake versus output and track the most recent ten days' average caloric deficit. I plan on writing a post about it, demonstrating how to use it. And I'll probably make the source code available in case anyone wants to improve it. Obviously, a GUI version would appeal to more people, but at the time I wrote it I was looking to get something functional ASAP as well as gain experience CLI programming using the Microsoft C# compiler, csc.exe. I used Notepad++ as my editor.

Covid or just some virus?

- Posted in Uncategorized by

It has been a busy week. Eleven groups and too many emails and spreadsheets. And to top it off, I think I'm coming down with something: too many aches in too many places. Hopefully it isn't Covid, back for round two.

I'm hoping to finish assessing Desolation RPG as a potential rules manual from which I can cherry-pick for my intended solo campaign. But I also need to work on 6 CEU hours for an EMDR training I purchased weeks ago. October 30th isn't that far off. I need to be able to show 10+ completed CEU hours to my licensing board.

Pack the pantry

- Posted in Uncategorized by

I ran in the Pack the Pantry event in Somerset today to raise money for a food donation effort through a local Somerset church. I figured I'm gonna jog anyway, might as well use it to help people, right? I think I did maybe five miles. If you want to see a larger version of the race bib, click the image in this blog post. Weather was sunny and mild. Great day for running. As is common in our area of the country, people were a bit insular. Hopefully, I can do this event again next year.

My races

- Posted in Uncategorized by

Pack the Pantry (Aug 03, 2019)


Noctua Trail Race (June 22, 2019)


Lakefest (July 14, 2019)


Dick's Sporting Goods "Run Your Run" Fundraiser (May 2019)


RenfroRun 5-Miler (Oct. 20, 2018) I came in 2nd...


Half-marathon in Bowling Green (Nov. 04, 2018)