473,405 Members | 2,445 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Font question

I'm using a particular font (for credit card symbols) within a crystal
report which looks fine when I preview, however when I run the report with
real data, the font is now shown correctly. It seems to revert back to a
standard font and displays letters instead of card symbols. Any ideas.?
Can I embed a font or include one in my VB app.?

Thanks
Dec 21 '05 #1
3 1450
Hi,

How to embed a font
http://www.bobpowell.net/embedfonts.htm

Ken
------------------------

"Chubbly Geezer" wrote:
I'm using a particular font (for credit card symbols) within a crystal
report which looks fine when I preview, however when I run the report with
real data, the font is now shown correctly. It seems to revert back to a
standard font and displays letters instead of card symbols. Any ideas.?
Can I embed a font or include one in my VB app.?

Thanks

Dec 21 '05 #2
Thanks Ken

not quite working correctly however.

Am using the following code:
-----
Imports System.Runtime.InteropServices

Imports System.IO

Imports System.Drawing.Text

Private Sub frmCrystalViewer_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

Try

Dim pfc As New PrivateFontCollection()

'load the resource

Dim fontStream As Stream =
Me.GetType().Assembly.GetManifestResourceStream("W ARCSubscriptionsLetterGenerator.TRPI____.PFB")

'create an unsafe memory block for the data

Dim data As System.IntPtr = Marshal.AllocCoTaskMem(fontStream.Length)

'create a buffer to read in to

Dim fontdata() As Byte

ReDim fontdata(fontStream.Length)

'fetch the font program from the resource

fontStream.Read(fontdata, 0, fontStream.Length)

'copy the bytes to the unsafe memory block

Marshal.Copy(fontdata, 0, data, fontStream.Length)

'pass the font to the font collection

pfc.AddMemoryFont(data, fontStream.Length)

'close the resource stream

fontStream.Close()

'free the unsafe memory

Marshal.FreeCoTaskMem(data)

Catch objE As Exception

MessageBox.Show(objE.Message)

End Try

End Sub

-----

I am using an Adobe *.PFB font as shown above.

The code error on

pfc.AddMemoryFont(data, fontStream.Length)

with a 'File Not Found' message.

I am running this code on the form_load of a form that contains a crystal
report viewer and the font in question is within my crystal report. Am
assuming that as long as the font is held in memory, where ever I view the
font should display correctly.

Thx

Chubbly

"Ken Tucker [MVP]" <Ke**********@discussions.microsoft.com> wrote in message
news:D9**********************************@microsof t.com...
Hi,

How to embed a font
http://www.bobpowell.net/embedfonts.htm

Ken
------------------------

"Chubbly Geezer" wrote:
I'm using a particular font (for credit card symbols) within a crystal
report which looks fine when I preview, however when I run the report
with
real data, the font is now shown correctly. It seems to revert back to a
standard font and displays letters instead of card symbols. Any ideas.?
Can I embed a font or include one in my VB app.?

Thanks

Dec 22 '05 #3
For such a Crystal report related question, you may get support from:

http://support.businessobjects.com

Luke

Dec 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

22
by: Martin Ernst | last post by:
Hello! I wonder which font is normally used in IE (6) for windows if i use "sans-serif" as font-family. Does anybody know it? Thanks Martin
133
by: Philipp Lenssen | last post by:
Why is there no standardized and well-working way for a web-page to offer the font for download/embed it, in order to be displayed on the page? No matter what you think of the preferred font of a...
131
by: Peter Foti | last post by:
Simple question... which is better to use for defining font sizes and why? px and em seem to be the leading candidates. I know what the general answer is going to be, but I'm hoping to ultimately...
4
by: Csaba Gabor | last post by:
What I'd like to do is to be able to set the font of a textarea element to the same font that another element is using (say, for example, an <INPUT type=text ...> element, but if that's a no go,...
10
by: Richard R Plourde | last post by:
I've got a problem that IE doesn't seem to use the entire font unicode subgroups from a hinted font file. When I display the following web page in IE 6 as opposed to Firefox 1.0 PR. Check out...
9
by: Dr John Stockton | last post by:
Assuming default set-ups and considering all reasonable browsers, whatever that may mean, what should an author expect that his readers in general will see (with visual browsers) for a page with...
9
by: Adam | last post by:
Can someone please help!! I am trying to figure out what a font is? Assume I am working with a fixed font say Courier 10 point font Question 1: What does this mean 10 point font Question 2:...
0
by: Chenghui Li | last post by:
We have a problem with the Windows XP theme: We have a IDE which allows other developers to develop visual programs for their customers. Our IDE allow them to set font for window captions easyly...
71
by: Mark | last post by:
Sorry if the question is a bit basic. I generally express my font sizes in pixels, originally to handle the Macintosh/Windows font size differences (though I believe that they both now treat...
14
by: Roedy Green | last post by:
Is there a shortcut way to define the default font family (and characteristics) to be applied to all styles? -- Roedy Green Canadian Mind Products The Java Glossary http://mindprod.com
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.