has anyone built their own font? (1 Viewer)

CJ_London

Super Moderator
Staff member
Local time
Today, 20:35
Joined
Feb 19, 2013
Messages
16,553
I'm building a gantt chart for a project management module using richtext. I need to draw connecting lines but the only font I've found with an appropriate characterset is MS Linedraw. The problem is, although the line characters meet horizontally, they don't vertically.



I can live with it but would prefer something that a) meets vertically and b) is perhaps a bit rounder rather than sharp angles. In total there are around 50 characters required (no alpha numeric text).

So unless someone can recommend an alternative font (I've not found one, but I might be using the wrong search phrase) or a way of closing the gap I thought I would give building my own a go and would appreciate any helpful advice - even 'don't bother because...'

edit: font needs to be monospaced (all chars same width aka courier) because each character represents a period of time

many thanks in advance
 

Attachments

  • Capture.JPG
    Capture.JPG
    18 KB · Views: 533

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 20:35
Joined
Jul 9, 2003
Messages
16,245
This looks interesting, "FontStruct" - Build, Share, Download Fonts. It's simple and free!

Looking through some of the font sets other people have made, in particular this one:- https://fontstruct.com/fontstructions/show/1616819/obviousfont looks very much like what you want. Not sure about adding colours?

Here's another fun which resembles your requirements:- https://fontstruct.com/fontstructions/show/1620531/stf-mizollen

Now this is very promising, look at the detail you can create it with this font creator. https://fontstruct.com/fontstructions/show/1570331/big-boned

And Another:- https://fontstruct.com/fontstructions/show/1548955/qualtron
 

CJ_London

Super Moderator
Staff member
Local time
Today, 20:35
Joined
Feb 19, 2013
Messages
16,553
Hi Tony,

That is where the gap is in the linedraw font - top of char. If all font's have to have it, then little point trying to grow my own at this time:)

I have discovered the bigger the font the smaller the gap (or perhaps it just looks smaller) at 36 font, barely noticeable. But 36 is too big for general use.

changing font size (and adjusting control/detail heights) does provide quite a nice zoom feature however.

Thanks for the links - I'll take a look. I had looked at a couple of online font builder sites but not in detail.

Have also consider using html and using a webbrowser control to add the lines but this is supposed to be 'quick and dirty' solution for personal consumption rather than a commercial product!
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 20:35
Joined
Jul 9, 2003
Messages
16,245
In my humble opinion FontStruct looks your best bet!

The only thing I couldn't find was how to move the font up or down, to give you the connection you need between rows. However this page:- https://fontstruct.com/help/63/expert_mode/extra_extra_guides does seem to offer something called ascenders, descenders which I take to mean having the "J" popping out of the bottom of the line, and possibly you could move a character up so it popped out of the top of the row of text.

Look at this "A" looks promising! https://youtu.be/Ap3VaRjeBi8?t=138
 

CJ_London

Super Moderator
Staff member
Local time
Today, 20:35
Joined
Feb 19, 2013
Messages
16,553
I've had a go with FontStruct - really easy to use.

Unfortunately it does not seem possible to remove the gap at the top of the character although I do seem to be able to reduce it. I've raised the question with them but suspect there are good reasons for the gap, perhaps to do with access since on their test page there is no gap.

The data is presented in a continuous form - and I seem to recall there is a 1 pixel?/point? around the detail section. Could be wrong

From a presentational perspective, adding a light border around the control does help to disguise the gap.

Either way I can create a more interesting font - rounded corners, small arrows etc - and for the straight lines use a 'dotted' line of some sort rather than a solid line

Thanks for your input Tony
 

Minty

AWF VIP
Local time
Today, 20:35
Joined
Jul 26, 2013
Messages
10,355
As a left field approach - do any of the Tree View type controls get around this issue?

Wondering if that could be adapted to give you the display you are after?
 

isladogs

MVP / VIP
Local time
Today, 20:35
Joined
Jan 14, 2017
Messages
18,186
I've had a go with FontStruct - really easy to use.

Unfortunately it does not seem possible to remove the gap at the top of the character although I do seem to be able to reduce it. I've raised the question with them but suspect there are good reasons for the gap, perhaps to do with access since on their test page there is no gap.

The data is presented in a continuous form - and I seem to recall there is a 1 pixel?/point? around the detail section. Could be wrong

From a presentational perspective, adding a light border around the control does help to disguise the gap.

Either way I can create a more interesting font - rounded corners, small arrows etc - and for the straight lines use a 'dotted' line of some sort rather than a solid line

When I was developing my example app Accurately Move Forms & Controls a few months ago, I also had to deal with the fact that there is a fixed gap between rows of text. IIRC it is 2px no matter what font size you use so it appears less obvious with a large font. The gap its there to ensure text remains legible and cannot be removed.
You should perhaps disguise it by using or designing a font with broken horizontal lines of the same size???

However surely there are suitable characters in Wingdings or another font of that kind?
 

CJ_London

Super Moderator
Staff member
Local time
Today, 20:35
Joined
Feb 19, 2013
Messages
16,553
@Minty - good thought I believe Tree view uses a winform so could perhaps draw lines rather than embed in the text, but can see there could be problems with locating each end. I've not used them in Access (assuming you can outside of an activeX), only Excel and then only for data input purposes.

@Colin - good to know it's 2px. Horizontal is not a problem, but I am going to design a dotted or dash-dot font anyway. At the moment still working on the algorithms to build the string - gets a bit more complex when real life scenarios are taken into account. What's that quote? 'a battleplan is only good until the first bullet is fired', something like that.

Have also investigated moving the richtext to a web control but that creates other problems - basically have to create a .htm file. Thought I had found a way to have it display text (https://www.pcreview.co.uk/threads/microsoft-access-html-viewer.4020665/) but the document property doesn't seem to exist for that solution
 

CJ_London

Super Moderator
Staff member
Local time
Today, 20:35
Joined
Feb 19, 2013
Messages
16,553
I presume the form was the controlsource? In which case not sure how that takes me forward

I was talking about assigning html code to a web control
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 15:35
Joined
Feb 28, 2001
Messages
27,001
This might be more than you really wanted to do, but there is the possibility of drawing that kind of diagram by dropping unbound text boxes and line controls, though it requires you to open either a form or a report in design mode via VBA. So one controlling form and one work of art?

You can get exact placement of lines to one twip and can control the thickness of those lines from hairline to fairly broad-brush size. You can do things with the height, width, top edge, and left edge of the text boxes as well as changing background and foreground colors as well as borders - which also can be controlled with respect to width.

I don't envy the nasty math parts, but consider this - lines will only be going in two directions based on what you showed us... down OR to the right. Further, once you know the scale of what you are trying to do, scaling line lengths is the simple math of proportions. So other than assuring you have room enough for the drawing, it should not be that hard.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 16:35
Joined
May 21, 2018
Messages
8,463
I would take a look at the Treeview control done in Winforms
https://www.jkp-ads.com/Download.asp
They make all the code available, and it open my eyes to some serious possibilities using this approach.
It is amazing how fast and efficient this is. I ran 10k of nodes up to 7 layers nested in seconds.

I would in no way consider doing this in an access form by drawing this dynamically. That will blow up pretty quick and be very inefficient.
 

Minty

AWF VIP
Local time
Today, 20:35
Joined
Jul 26, 2013
Messages
10,355
@MajP - Thanks that was the one I was trying to find.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 20:35
Joined
Feb 19, 2013
Messages
16,553
@Doc. I've looked as using textboxes, but the issue is they need to move around horizontally which won't work in a continuous form or report.

The basis I'm using at the moment uses a richtext field populated with spaces and code then changes the backcolor and characters where required. The characterset is monospace so the width of each character represents a period of time. Since a long text field can hold around 65k characters, that should be more than enough. not tested in detail yet but zooming can be achieved by changing the font size and adjusting the control and detail heights accordingly.

Using monospace it's a bit like the screen mapping on the original monitors - 40 or 80 columns x 24 rows.

The line calculations are not too difficult - I calculate top/left coordinates for the end of the dependant task and bottom/right for the start of the next task based or row and column numbers.

@Maj - Micron suggested the same thing and I will take a look, but this project is just personal for me at the moment for a building project, the data all works, I just wanted a quick way to get a visual impression of what the project looks like and don't really have the time at the moment - but there is a bank holiday coming up!

The original issue was around removing the space at the top of the font which can't be done - even with my own design of font.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 15:35
Joined
Feb 28, 2001
Messages
27,001
Actually, MajP, I wasn't mentioning it as something I would have done - but who is to say how much work anyone is willing to do to get a job done? I tossed out an idea to be taken or shot down with no expectations either way.

I'll mention another way I have tried via experiment to do family tree diagrams. Don't try to use Excel's "TextArt" feature. From the manual interface, it is OK. From VBA, sucks big-time because you have no clarity of how to control child objects. Tends to crash EXCEL a lot, too!
 

Users who are viewing this thread

Top Bottom