1
0
mirror of https://github.com/pdf2htmlEX/pdf2htmlEX.git synced 2024-07-05 01:28:39 +00:00

remove boost::algorithm

This commit is contained in:
Lu Wang 2012-09-10 02:26:10 +08:00
parent 02a735aa9f
commit a9cc5b7031
2 changed files with 8 additions and 16 deletions

View File

@ -8,15 +8,12 @@
*/
#include <sstream>
#include <boost/algorithm/string.hpp>
#include <cctype>
#include "HTMLRenderer.h"
#include "namespace.h"
#include "config.h"
using boost::algorithm::ifind_first;
void HTMLRenderer::export_remote_font(const FontInfo & info, const string & suffix, const string & fontfileformat, GfxFont * font)
{
allcss_fout << "@font-face{font-family:f" << info.id << ";src:url(";
@ -57,12 +54,16 @@ void HTMLRenderer::export_local_font(const FontInfo & info, GfxFont * font, cons
allcss_fout << ".f" << info.id << "{";
allcss_fout << "font-family:" << ((cssfont == "") ? (original_font_name + "," + general_font_family(font)) : cssfont) << ";";
if(font->isBold() || ifind_first(original_font_name, "bold"))
string fn = original_font_name;
for(auto iter = fn.begin(); iter != fn.end(); ++iter)
*iter = tolower(*iter);
if(font->isBold() || (fn.find("bold") != string::npos))
allcss_fout << "font-weight:bold;";
if(ifind_first(original_font_name, "oblique"))
if(fn.find("oblique") != string::npos)
allcss_fout << "font-style:oblique;";
else if(font->isItalic() || ifind_first(original_font_name, "italic"))
else if(font->isItalic() || (fn.find("italic") != string::npos))
allcss_fout << "font-style:italic;";
allcss_fout << "line-height:" << (info.ascent - info.descent) << ";";

View File

@ -7,18 +7,9 @@
* 2012.08.14
*/
#if 0
// for gil bug
const int *int_p_NULL = nullptr;
#include <boost/gil/gil_all.hpp>
#include <boost/gil/extension/io/png_dynamic_io.hpp>
#endif
#include "HTMLRenderer.h"
#include "namespace.h"
//using namespace boost::gil;
void HTMLRenderer::drawImage(GfxState * state, Object * ref, Stream * str, int width, int height, GfxImageColorMap * colorMap, GBool interpolate, int *maskColors, GBool inlineImg)
{
return OutputDev::drawImage(state,ref,str,width,height,colorMap,interpolate,maskColors,inlineImg);