You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wrote a Windows Form program and used a special font in the program! In the name of "FredokaOne.ttf", I have installed the font and the font is displayed well in the program, but it was not displayed in my friend's system, which does not have the font installed.
program in my pc:
program in Other pc:
I added that font to my project's resources, but it still didn't change :
public Form1() { InitializeComponent(); LoadCustomFont(); } private void LoadCustomFont() { PrivateFontCollection privateFonts = new PrivateFontCollection(); // Load the font from resources byte[] fontData = Properties.Resources.FredokaOne_Regular; // Assuming the font file is named FredokaOne.ttf IntPtr fontPtr = Marshal.AllocCoTaskMem(fontData.Length); Marshal.Copy(fontData, 0, fontPtr, fontData.Length); privateFonts.AddMemoryFont(fontPtr, fontData.Length); Marshal.FreeCoTaskMem(fontPtr); // Apply the font to a control button1.Font = new Font(privateFonts.Families[0], 12,FontStyle.Regular); copy_button.Font = new Font(privateFonts.Families[0], 12, FontStyle.Regular); label1.Font = new Font(privateFonts.Families[0], 12, FontStyle.Regular); label2.Font = new Font(privateFonts.Families[0], 12, FontStyle.Regular); }
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I wrote a Windows Form program and used a special font in the program! In the name of "FredokaOne.ttf", I have installed the font and the font is displayed well in the program, but it was not displayed in my friend's system, which does not have the font installed.
program in my pc:

program in Other pc:

I added that font to my project's resources, but it still didn't change :
Beta Was this translation helpful? Give feedback.
All reactions