<commit_before>#include "LabelNew.h"
//#include "DynamicFont.h"
#include "DynamicTexAndFont.h"

#include "common/color_trans.h"
#include "common/Config.h"
#include "dataset/text_util.h"
#include "dataset/TPNode.h"
#include "render/ShaderMgr.h"

//#define LABEL_USE_CACHE

namespace d2d
{

void LabelNew::Print(const char* text, const Vector& pos,
					 float scale, const LabelStyle& style)
{
	if (strlen(text) == 0) {
		return;
	}

#ifdef LABEL_USE_CACHE
	const LabelLayout::Layout* layout = LabelLayout::Instance()->Query(text);
	if (!layout) 
	{
		LabelLayout::Layout* new_layout = new LabelLayout::Layout;
		std::vector<int> unicodes;
		std::vector<wxString> utf8s;
		TransToUnicodes(text, unicodes, utf8s);

		std::vector<Line> lines;
		int tot_line_height = TransToLines(unicodes, utf8s, style, lines);

		if (!lines.empty()) {
			DrawLines(pos, style, lines, tot_line_height, *new_layout);
		}
<commit_msg>[CHANGED] 关掉老版本label draw<commit_after>#include "LabelNew.h"
//#include "DynamicFont.h"
#include "DynamicTexAndFont.h"

#include "common/color_trans.h"
#include "common/Config.h"
#include "dataset/text_util.h"
#include "dataset/TPNode.h"
#include "render/ShaderMgr.h"

//#define LABEL_USE_CACHE

namespace d2d
{

void LabelNew::Print(const char* text, const Vector& pos,
					 float scale, const LabelStyle& style)
{
	return;

	if (strlen(text) == 0) {
		return;
	}

#ifdef LABEL_USE_CACHE
	const LabelLayout::Layout* layout = LabelLayout::Instance()->Query(text);
	if (!layout) 
	{
		LabelLayout::Layout* new_layout = new LabelLayout::Layout;
		std::vector<int> unicodes;
		std::vector<wxString> utf8s;
		TransToUnicodes(text, unicodes, utf8s);

		std::vector<Line> lines;
		int tot_line_height = TransToLines(unicodes, utf8s, style, lines);

		if (!lines.empty()) {
			DrawLines(pos, style, lines, tot_line_height, *new_layout);
		}

{'fraction_non_alphanumeric': 0.14664502164502163, 'fraction_numerical': 0.005411255411255411, 'mean_word_length': 5.465034965034965, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7572901', 'n_tokens_mistral': 720, 'n_tokens_neox': 682, 'n_words': 143}