How to Create a Simple Black Outline Around Font? (1 Viewer)

mementomadi

New member
Local time
Yesterday, 21:04
Joined
Dec 27, 2016
Messages
7
I'm racking my brain, is there a simple way to do this that I'm just missing?

I'm trying to match the set-up of an already existing government form to create a report in Access. The form I'm matching uses a simple black outline around some of the letters.

I've emulated it using a graphic design program but the print-out of the image is low-res and I'd prefer something that looks sharper.

I've thought of laying one instance of the text over another instance of the same text in a slightly larger size and "cheating" the appearance of an outline but since I can't adjust the spacing between the characters this doesn't work very well.

I was thinking I may be able to use an "outline" free font I download from a free font site to do something similar, but I'm hoping to avoid this.
 
Find or recreate the outlined Font and use it in the report.
 
If this is a government project, ask the people from whom you GOT that form if they used a particular font. If so, see if YOU can download it from them. Having worked with the government, I can tell you that anything the government owns is owned by every branch and every office. And if it becomes a government-furnished element, it is not necessary to avoid the oddball font.
 
Thanks for the prompt reply, guys. This does seem like a great place to learn.

I'm mostly just curious if there's a way to make this happen on a report without resorting to special fonts or embedding a special image.

The only thing I'm trying to outline is the numbers "2" and "0" in 2015 - the rest the "1" and the "5" is just the normal, plain, black font

I attempted to post a picture of the look I'm going for, but at this time I am unable to due to my low post count. Just a Google Images search of "outlined font" should be more than adequate, though. :cool:
 
Another solution comes to mind.

Generate your date as a string. Make the field that contains the year number into two text boxes. Use Mid or Left to extract the first two digits and Mid or Right to extract the last two digits. Make the right-hand side normal font with black print/white background. Make the left-hand side normal font with white print/black background.
 
Thank you both. I didn't make this clear in the original post but I'm still new to Access and still learning to visualize how this VBA code will look/work. Please bear with my amateurish questions; I do apologize. I don't know if this was clear in my first post, but the whole report has already been remade in Access but I'm altering it to reflect a minor change in appearance for the next year if it helps to know.

apr pillai, I tried to paste that code into the On Load event on a new report to better understand it but am having trouble figuring out how to manipulate it to suit my needs. I understand that there should be five labels that are being automated to move into the correct positioning but I only see one label named in the code: "lblName." I see where I change the font name "Times New Roman" to my own font. I don't quite understand where I change the color yet, but I figure if I can get this code to work for your example I might be able to figure that out.

The_Doc_Man, thank you for your response also. It sounds like it could be a simple solution but I don't quite understand. Are you able to elaborate/explain it differently?
 
Using VBA code, you can take out the YEAR of a date field using

Code:
YearString = Format( datefield, "yyyy" )

You can then use Right(Yearstring, 2) to get the right-most 2 digits and Left(Yearstring, 2) to get the left-most 2 digits. After you did that, this year would be expressed according to "20" in the left-side string and "17" in the right side string.

Now, instead of having one control for the year, have TWO controls - and invert the black and white ports of the left-side control. You can put the code to do this in the OnFormat event for the place where this date has to go. Like, if it was for the page header, then in the PageHeader_Format event, you would pick up the date in question, do the format on a temporary string holder, do the Left and Right functions, and then store the string values in the respective controls. You can statically invert the color scheme by making the background black and the foreground white on the left-side control, leaving the right-side control in its conventional state of white background and black letters.
 
Read the Article carefully and try to understand the details explained there.

1.You should paste the code into a VBA Global module and save it.
2. Run the function Border2D() with necessary parameters (explained there) from the VBA Debug window by typing the command directly.
Note: A new Form will be created automatically by the program with the Label or Textbox (depending on the parameter selection) with sample font.
3. Open this form in design view, click and hold the left mouse button near the labels and drag over the Border-2D labels to select all of them together.
4. Display the Property Sheet (F4) and change the Font property value, style:italic, Bold etc. but NOT THE COLOR.
5. Now, if you need to change the top-most label's font-color, click only on the top label carefully so that it should not move from it's correct position.
6. Change the font fore-color of your choice.
7. After making the required change select all the labels together again, as explained above.
8. Right-click and select Copy and paste them wherever you want: on another Form or on Report.

You may download a sample Demo Database with all the heading styles and VBA code from the link I have provided in the earlier post.
 
apr pillai -- again, thank you!! I created a new module using the original chunk of code, and made sure to activate the references outlined in your article.

I'm getting stuck when trying to run this command from the debug window

Code:
Border2D 4,15,0

The error message is "sub or function not defined." I'm guessing there's a component I'm missing?

So using your directions on your article I tried instead creating a new form with a command button cmdBorder2D (as well as two text boxes one named txtForeColor and the other txtBorderColor and using this bit of code in the On-Click event of the command button:

Code:
Private Sub cmdBorder2D_Click()

   Border2D Me![txtForeColor], Me![txtBorderColor],0

End Sub

But I'm getting an invalid use of null error.

Thanks again for your patience. I'll be overjoyed to be able to get this to work.
 
The_Doc_Man - thank you, I'm currently digesting your comment and figuring out how to try what you're recommending. Will try to respond properly when I wrap my mind around it a little better.
 
I am very sorry about something I overlooked before posting my suggestions for a step by step procedure for you to try out.

There are few common functions which I have introduced in an earlier post and they are being used in all subsequent 2D, 3D title creations. I introduced the second post to you straight away so that you did not get a chance to copy the common functions and paste them into your new Global Module.

As a quick remedy find this link:Create 3D Headings on Forms and copy all the VBA Code on that page and paste the code above the Border2D() function Code without overwriting the Border2D() Code. They must be placed above because there are some Global Variable Declarations on top of the code and they must appear at the beginning of the Module. Alternatively, you may save these code into a new Global Module.

After saving these code you may open the new Form you have created for Border2D and click on the Command Button after filling up the TextBoxes with appropriate values, it will work.

I am very sorry about the trouble you have been through. These posts were created 10 years back and I lost touch with it for some time.

Please try it out and let me know, if you need more help.

You can find other heading styles on these links:
Border 3D Heading
Shadow 3D Heading Style
 
Last edited:
It would be helpful if you would post an image of what you are trying to create.

You might be trying to duplicate what a high end graphic app, like Adobe PhotoShop, can do. They may also have used Desktop Publishing software. These are not dynamically generated. A Graphics designer possibly spend a lot of time making this form.

If it were me, I would try scanning the document and cropping out the image.

I use Phtoshop and the free Paint.net (GIMP is also free) to create images for us on forms and reports.
 
Thanks all.

I actually have a background in graphic design. I was just seeing if it would be possible to recreate the effect using Access as I'm thinking that if it were text it'd be more likely to print out clearly/higher res.

I think in the end I will use an image to get this project finished but thanks for clarifying apr pillai. I will give your code a try just for practice.
 

Users who are viewing this thread

Back
Top Bottom