修改字体

This commit is contained in:
2026-02-08 00:13:16 +08:00
parent c819327f85
commit 85fa99f7bd
5 changed files with 63 additions and 6 deletions

2
Build.bat Normal file
View File

@@ -0,0 +1,2 @@
"D:\Microsoft Visual Studio\18\Community\MSBuild\Current\Bin\amd64\MSBuild.exe" "CMLeonOS.csproj" /t:Build /p:Configuration=Fixed_Release /p:Platform=x64
@REM "C:\Program Files (x86)\VMware\VMware Workstation\vmplayer.exe" "C:\Users\leon\AppData\Roaming\Cosmos User Kit\Build\VMware\Workstation\Cosmos.vmx"

View File

@@ -15,7 +15,7 @@
<StartCosmosGDB>False</StartCosmosGDB>
<VisualStudioDebugPort>Pipe: Cosmos\Serial</VisualStudioDebugPort>
<CosmosDebugPort>Serial: COM1</CosmosDebugPort>
<Launch>VMware</Launch>
<Launch>HyperV</Launch>
<Profile>VMware</Profile>
<Description>Use VMware Player or Workstation to deploy and debug.</Description>
<PxeInterface>192.168.0.8</PxeInterface>
@@ -30,7 +30,37 @@
<VBEResolution>800x600x32</VBEResolution>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<WarningLevel>8</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<WarningLevel>8</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<WarningLevel>8</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<WarningLevel>8</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Fixed_Release|AnyCPU'">
<WarningLevel>8</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Fixed_Release|x64'">
<WarningLevel>8</WarningLevel>
</PropertyGroup>
<ItemGroup>
<None Remove="font.psf" />
<None Remove="Solarize.12x29.psf" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="font.psf" />
<EmbeddedResource Include="Wallpapers\wallpaper.bmp" />
</ItemGroup>

View File

@@ -1,19 +1,23 @@
using CMLeonOS.Logger;
using CMLeonOS.Settings;
using Cosmos.HAL;
using Cosmos.HAL.BlockDevice;
using Cosmos.HAL.Drivers.Video;
using Cosmos.System.FileSystem;
using Cosmos.System.FileSystem.FAT;
using Cosmos.System.FileSystem.VFS;
using Cosmos.System.Graphics;
using Cosmos.System.Graphics.Fonts;
using Cosmos.System.Network.Config;
using Cosmos.System.Network.IPv4.UDP.DHCP;
using Cosmos.HAL.BlockDevice;
using Cosmos.System.Network.IPv4;
using Cosmos.System.Network.IPv4.UDP.DHCP;
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection.Metadata.Ecma335;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using Sys = Cosmos.System;
using CMLeonOS.Logger;
using CMLeonOS.Settings;
namespace CMLeonOS
{
@@ -31,9 +35,31 @@ namespace CMLeonOS
public static Cosmos.HAL.NetworkDevice NetworkDevice = null;
public static string IPAddress = "Unknown";
[IL2CPU.API.Attribs.ManifestResourceStream(ResourceName = "CMLeonOS.font.psf")]
public static readonly byte[] file;
protected override void BeforeRun()
{
// 我认了,我用默认字体
// try
// {
// PCScreenFont screenFont = PCScreenFont.LoadFont(file);
// VGAScreen.SetFont(screenFont.CreateVGAFont(), screenFont.Height);
// VGAScreen.SetGraphicsMode(VGADriver.ScreenSize.Size720x480, ColorDepth.ColorDepth32);
// }
// catch (Exception ex)
// {
// 我不认我试着转换成Base64
// 我认了
PCScreenFont defaultFont = PCScreenFont.Default;
VGAScreen.SetFont(defaultFont.CreateVGAFont(), defaultFont.Height);
// Console.WriteLine($"{defaultFont.Height}");
// Console.WriteLine($"{defaultFont.Width}");
// VGAScreen.SetGraphicsMode(VGADriver.ScreenSize.Size720x480, ColorDepth.ColorDepth32);
// Console.WriteLine($"Error loading font: {ex.Message}");
// }
Console.WriteLine("Kernel load done!");
Console.WriteLine(@"-------------------------------------------------");
Console.WriteLine(@" ____ __ __ _ ___ ____ ");

BIN
font.psf Normal file

Binary file not shown.

View File

@@ -19,7 +19,6 @@ using Cosmos.Core.Memory;
using UniLua;
using Cosmos.HAL;
using CMLeonOS.Commands;
namespace CMLeonOS
{
public class Shell