Compressed and encoded embedded 3DPB font.

Exposed ImGui function for decompressing embedded data.
This commit is contained in:
Muzychenko Andrey 2021-09-29 10:08:45 +03:00
parent b37f5d6d76
commit ba5a0f3044
6 changed files with 82 additions and 10 deletions

View file

@ -28,6 +28,8 @@ endforeach()
set(SOURCE_FILES
SpaceCadetPinball/control.cpp
SpaceCadetPinball/control.h
SpaceCadetPinball/EmbeddedData.cpp
SpaceCadetPinball/EmbeddedData.h
SpaceCadetPinball/fullscrn.cpp
SpaceCadetPinball/fullscrn.h
SpaceCadetPinball/gdrv.cpp

View file

@ -0,0 +1,46 @@
#include "EmbeddedData.h"
#if 1
// File: './PB_MSGFT.bin' (21702 bytes)
// Exported using binary_to_compressed_c.cpp
const char EmbeddedData::PB_MSGFT_bin_compressed_data_base85[5380 + 1] =
"7])#######>s+cc'/###Y[fi'.Y`+V*KI@%CtjT%QRR8%D[eW$G$^m&MQ>3'QK#n&FnJm&Vp:0(SWPN'SgYn&E09q%`sYn&V9B6&Z#dn&Hnj5&8uhV$Q?p2'L0K6&;@@<$SA`.2EIes$"
"RTp6&A.MZ#?@R8%]IN:-42$4CT5(a4`%5DN$rJfLe7^-#`cb*&]u#K262Q_/CR*a4qTjjMHug;-PgRfM-sJfL9#?9RqM>=-/WDa->?1I$[R/qLuqJfLxj/gLPCg;-r28r7H-ge$wKiWh"
"vR.(8.C@lL/<T4MnLT_-VeJe?G-Cx9BEwcMYV$2Mbo4VMm4`;-#K5p%o-L&#*rE2C]x+@'aY.FRpjot7kXjJ2'CDiL)e./M^c'hM2s@/M):*NMt3*NM[i,aOcHLaP7?K4MI1$##0ucDN"
")J7FN7^e*N4s(eMcPi+8VZKd4^dTd%_IAgWJCSrL>r&gL-0pKN?lgwL[BCTM5>UkL]`kgMw3US->aDY$,oF&#9&j-HA3nw'/%=2C:FW'8..w-$ae`n*a2Kwp:(t-$X<8w^V`w_/*TKs-"
";c>]OW>pgLSHJ_%=0[GMZMFgMmZGhN>4ZtMsg&gL%o^wL)<N;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"
"Y5=2C`Fws7Bhki$MJ$-++`_8RWmU9R$ui$G;6Na,I8g$&g5<NKm=mQqg/mW%5e7QAG+gVgal^)O-iT`$h1?qtQq,KlOeMo>x9f$nwTWJ']jk=-3^^m2vZ8@(#O,W8$Gj9DZRV49/J=P;"
"``a;&#pbJ28k)e<?_`xfPn;J:H@xNOWj9hjtlH.'lq8-;L&4TBpL0@%49Tp7SRqw.Rfu<'^<FK:ll)FPwl'LMBIDJD/uwd;%V6XA1<.G:-IbQ)=HJv&ZF--M3v[O.m_=p^)A6wJGUn@'"
"SK``-)or4#NImdM.O?a$`nOE<Y0:+?v=PkLN34S2T=B<H=k[1E&8,c'whm;-[f*$%_7MaNZg*`+-jD4:XW_c/Y2nZ>AA`/s+j&BH>:oB&&g1<-N:md$bSYm8#u^7).4H0&q3n0#B[G&#"
"%baa*`3t,;Nm>v]^JtC(mC:/%*WN7:aarL7;f[=-XbnHbSm`I&Z?ap7[pZ@1dIa:8FZkL:p,kRM^$lf%92@v&mCeA-XHFK&t/c9BBP)CZSu>*(]G8l#>aD<okffx2c@-c*EUkE<_`fG5"
"8Wjb:XgxcPEcZ6)8q&_S/]^GMZr6Tg?oOb*i^qpIUDGn(<UI@ZPbm##S%o,;V^8U)_.idDhTF&##h$<?'s-+6W@-C?k+kx'_MuAO;3r2'NH0K:(._r(PCZY#Ij[1$:j61U$h,A-av4A="
"W)Y?e>L'k$XRf2Nn-8V8*lb`69FF3N@uNe+.AYXS9ALPSV/-Y$<H=n/4####";
#endif

View file

@ -0,0 +1,8 @@
#pragma once
class EmbeddedData
{
public:
static const char PB_MSGFT_bin_compressed_data_base85[5380 + 1];
};

View file

@ -2722,6 +2722,9 @@ struct ImFontAtlas
typedef ImFontAtlasCustomRect CustomRect; // OBSOLETED in 1.72+
//typedef ImFontGlyphRangesBuilder GlyphRangesBuilder; // OBSOLETED in 1.67+
#endif
// Compressed base85 is useful for more than embedded TTF
static char* DecompressCompressedBase85Data(const char* compressed_data_base85); // 'compressed_data_base85' still owned by caller. Compress with binary_to_compressed_c.cpp with -base85 parameter.
};
// Font runtime data and rendering

View file

@ -4174,4 +4174,17 @@ static const char* GetDefaultCompressedFontDataTTFBase85()
return proggy_clean_ttf_compressed_data_base85;
}
char* ImFontAtlas::DecompressCompressedBase85Data(const char* compressed_data_base85)
{
int compressed_data_size = (((int)strlen(compressed_data_base85) + 4) / 5) * 4;
void* compressed_data = IM_ALLOC((size_t)compressed_data_size);
Decode85((const unsigned char*)compressed_data_base85, (unsigned char*)compressed_data);
const unsigned int buf_decompressed_size = stb_decompress_length((const unsigned char*)compressed_data);
unsigned char* buf_decompressed_data = (unsigned char*)IM_ALLOC(buf_decompressed_size);
stb_decompress(buf_decompressed_data, (const unsigned char*)compressed_data, (unsigned int)compressed_data_size);
IM_FREE(compressed_data);
return (char*)buf_decompressed_data;
}
#endif // #ifndef IMGUI_DISABLE

File diff suppressed because one or more lines are too long