<commit_before>//
//  DHFont.m
//  DHxls
//
//  Created by <NAME> on 10/7/08.
//  Copyright 2008-2013 <NAME>. All rights reserved.
//

#include <stdint.h>
#include <string>

#include "xlslib.h"

#if 0
#import "font.h"
#endif

using namespace xlslib_core;
using namespace xlslib_strings;

#import "DHFont.h"

#define FONT(a) ((xlslib_core::font_t *)(a))

@implementation DHFont
{
	void		*_font;		// xlslib_core::CFont *
}

-(instancetype)initWithFont:(void *)ft
{
	self = [super init];
	
	_font = ft;
	
	return self;
}
-(void *)font
{
	return _font;
}

-(void)setName:(NSString *)name
{
	FONT(_font)->SetName([name cStringUsingEncoding:NSASCIIStringEncoding]);
}
-(NSString *)name
{
	const std::string&	name = FONT(_font)->GetName();
	
	NSString *string = [NSString stringWithCString:name.c_str() encoding:NSASCIIStringEncoding];
	
	return string;
}
-(void)setHeight:(uint16_t)fntheight
{
	FONT(_font)->SetHeight(fntheight);
}
-(uint16_t)height
{
	return FONT(_font)->GetHeight();
}
-(void)setBoldStyle:(boldness_option_t)fntboldness
{
	FONT(_font)->SetBoldStyle(fntboldness);
}
-(uint16_t)boldStyle
{
	return FONT(_font)->GetBoldStyle();
}
-(void)setUnderlineStyle:(underline_option_t)fntunderline
{
	FONT(_font)->SetUnderlineStyle(fntunderline);
}
-(uint8_t)underlineStyle
{
	return FONT(_font)->GetBoldStyle();
}
-(void)SetScriptStyle:(script_option_t)fntscript
{
	FONT(_font)->SetScriptStyle(fntscript);
}
-(uint16_t)scriptStyle
{
	return FONT(_font)->GetBoldStyle();
}
-(void)setColorName:(color_name_t)fntcolor
{
	FONT(_font)->SetColor(fntcolor);
}
-(void)setColorIndex:(unsigned8_t)fntcolor
{
	FONT(_font)->SetColor(fntcolor);
}
-(uint16_t)colorIndex
{
	return FONT(_font)->GetColorIdx();
}
#if 1
-(void)setItalic:(BOOL)it
{
	FONT(_font)->SetItalic(it);
}
-(BOOL)italic
{
	return (BOOL)FONT(_font)->GetItalic();
}
-(void)setStrikeout:(BOOL)so
{
	FONT(_font)->SetStrikeout(so);
}
-(BOOL)strikeOut
{
	return (BOOL)FONT(_font)->GetStrikeout();
}
-(void)setOutline:(BOOL)ol
{
	FONT(_font)->SetOutline(ol);
}
-(BOOL)outline
{
	return (BOOL)FONT(_font)->GetOutline();
}
-(void)setShadow:(BOOL)sh
{
	FONT(_font)->SetShadow(sh);
}
-(BOOL)shadow
{
	return (BOOL)FONT(_font)->GetShadow();
}
#endif

-(void)setFamily:(uint8_t)fam
{
	FONT(_font)->SetFamily(fam);
}
-(uint8_t)family
{
	return FONT(_font)->GetFamily();
}
-(void)setCharset:(uint8_t)fam
{
	FONT(_font)->SetCharset(fam);
}
-(uint8_t)charset
{
	return FONT(_font)->GetCharset();
}
@end<commit_msg>Removing casting in DHFont that was made unnecessary due to move to ivars in implementation.<commit_after>//
//  DHFont.m
//  DHxls
//
//  Created by <NAME> on 10/7/08.
//  Copyright 2008-2013 <NAME>. All rights reserved.
//

#include <stdint.h>
#include <string>

#include "xlslib.h"

#if 0
#import "font.h"
#endif

using namespace xlslib_core;
using namespace xlslib_strings;

#import "DHFont.h"

#define FONT(a) ((xlslib_core::font_t *)(a))

@implementation DHFont
{
	xlslib_core::font_t *_font;
}

-(instancetype)initWithFont:(void *)ft
{
	self = [super init];
	
	_font = FONT(ft);
	
	return self;
}
-(void *)font
{
	return _font;
}

-(void)setName:(NSString *)name
{
	_font->SetName([name cStringUsingEncoding:NSASCIIStringEncoding]);
}
-(NSString *)name
{
	const std::string&	name = _font->GetName();
	
	NSString *string = [NSString stringWithCString:name.c_str() encoding:NSASCIIStringEncoding];
	
	return string;
}
-(void)setHeight:(uint16_t)fntheight
{
	_font->SetHeight(fntheight);
}
-(uint16_t)height
{
	return _font->GetHeight();
}
-(void)setBoldStyle:(boldness_option_t)fntboldness
{
	_font->SetBoldStyle(fntboldness);
}
-(uint16_t)boldStyle
{
	return _font->GetBoldStyle();
}
-(void)setUnderlineStyle:(underline_option_t)fntunderline
{
	_font->SetUnderlineStyle(fntunderline);
}
-(uint8_t)underlineStyle
{
	return _font->GetBoldStyle();
}
-(void)SetScriptStyle:(script_option_t)fntscript
{
	_font->SetScriptStyle(fntscript);
}
-(uint16_t)scriptStyle
{
	return _font->GetBoldStyle();
}
-(void)setColorName:(color_name_t)fntcolor
{
	_font->SetColor(fntcolor);
}
-(void)setColorIndex:(unsigned8_t)fntcolor
{
	_font->SetColor(fntcolor);
}
-(uint16_t)colorIndex
{
	return _font->GetColorIdx();
}
#if 1
-(void)setItalic:(BOOL)it
{
	_font->SetItalic(it);
}
-(BOOL)italic
{
	return (BOOL)_font->GetItalic();
}
-(void)setStrikeout:(BOOL)so
{
	_font->SetStrikeout(so);
}
-(BOOL)strikeOut
{
	return (BOOL)_font->GetStrikeout();
}
-(void)setOutline:(BOOL)ol
{
	_font->SetOutline(ol);
}
-(BOOL)outline
{
	return (BOOL)_font->GetOutline();
}
-(void)setShadow:(BOOL)sh
{
	_font->SetShadow(sh);
}
-(BOOL)shadow
{
	return (BOOL)_font->GetShadow();
}
#endif

-(void)setFamily:(uint8_t)fam
{
	_font->SetFamily(fam);
}
-(uint8_t)family
{
	return _font->GetFamily();
}
-(void)setCharset:(uint8_t)fam
{
	_font->SetCharset(fam);
}
-(uint8_t)charset
{
	return _font->GetCharset();
}
@end
{'fraction_non_alphanumeric': 0.1826086956521739, 'fraction_numerical': 0.012836438923395446, 'mean_word_length': 6.093979441997063, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 61, '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': '3532699', 'n_tokens_mistral': 2087, 'n_tokens_neox': 1967, 'n_words': 278}